You are here: Re: Disable printing of flash in favour of internal content « HTML « IT news, forums, messages
Re: Disable printing of flash in favour of internal content

Posted by cwdjrxyz on 03/16/07 21:58

On Mar 16, 11:58 am, Neo Geshel <got...@geshel.org> wrote:
> cwdjrxyz wrote:
> > On Mar 15, 7:00 pm, Neo Geshel <got...@geshel.org> wrote:
> >> Greetings.
>
> >> BACKGROUND:
>
> >> My sites are pure XHTML 1.1 with CSS 2.1 for markup. My pages are
> >> delivered as application/xhtml+xml for all non-MS web clients, and as
> >> text/xml for all MS web clients (Internet Explorer).
>
> >> My flash content was originally brought in via the "flash satay" method,
> >> but I have since used some server-side magic do deliver one <object> tag
> >> for IE and another <object> tag for non-IE clients. That way, IE gets
> >> its codebase and classid attributes, which would cause any non-IE client
> >> to ignore the object element entirely.
>
> >> PROBLEM:
>
> >> My problem now is with printing. I can't for the life of me figure out
> >> how to get browsers to IGNORE the object element when printing - so that
> >> they grab the alternative content inside of the object element instead.
>
> >> You see, inside of my object element is a very nicely formatted header
> >> element (h1 to be exact), and I want this to appear when printing, but
> >> not in any other case. I also want this to appear when the object tag
> >> fails (for example, when someone does not have Flash installed).
>
> >> I would normally consider using SWFObject, but it does not make use of
> >> standards-compliant JavaScript (it uses document.write), and therefore
> >> will break when pages make use of the application/xhtml+xml mime type.
> >> In addition, it craps out when people fail to have JS turned on, or
> >> whose browsers (cellphones, handhelds) do not make use of JS. My sites
> >> are meant to be fully compatible and accessible! I am not looking to
> >> have content created by JS!
>
> >> IMPORTANT:
>
> >> Please understand, I am looking for a way, during printing, for the
> >> printer to ignore the object element itself in favour of the h1 element
> >> that exists inside the object element. This h1 element exists inside the
> >> object element because it is the "graceful degradation" content for
> >> anyone without Flash (or the correct version of Flash). I am not willing
> >> to entertain any other arrangement of elements (or element creation via
> >> JavaScript) unless it is equally as backward-compatible, elegant and
> >> standards-compliant. Preferably, I am looking for a CSS solution.
>
> >> TIA.
> >> ...Geshel
> >> --
> >> *********************************************************************
> >> My return e-mail address is an automatically monitored spam honeypot.
> >> Do not send e-mail there unless you wish to be reported as a spammer.
> >> Please send all e-mail to my first name at my last name dot org, with
> >> a subject-line of "NEWSGROUP REPLY FOR NEO GESHEL" (all uppercase).
> >> *********************************************************************
>
> > It is very difficult to respond to you without the source code
> > available to view. However, since I have a working flash page up that
> > is at the xhtml 1.1 level, I will point you to it so that you can see
> > if anything there will help you. The page is at
> >http://www.cwdjr.info/video_extreme/cancanFLV.php. The source code
> > you get will be xhtml 1.1 for browsers such as recent Firefox, Opera,
> > Seamonkey, and Mozilla that say they will at least accept 1.1 in the
> > header exchange. The page is served as html 4.01 strict to other
> > browsers, some of which might support xhtml 1.1, but do not say so in
> > the header exchange. The IE browsers get served html 4.01, for
> > example.
>
> > Microsoft conditional comments are used to route to one object path
> > for IE and close relatives such as MSN and ATT/Yahoo DSL browsers.
> > Thus you can make each path completely different if you wish, and you
> > do not have to use script to do so. It is up to you to see if this
> > approach might help with your printer problem.
>
> > Please note the high resolution video is designed for DSL. A loading
> > status bar built into the control bar generated when coding the swf
> > and flv files shows download progress. Also the swf file is rather
> > small as it is just a container file that generates controls etc. The
> > actual video is a separate swf which is large. This is the modern
> > method for using flash video and is now heavily used for videos by
> > Google, YouTube, MySpace, and several news sites.
>
> Here is my code:
>
> <object id="head" type="application/x-shockwave-flash"
> data="/swf/header.swf" width="758" height="200">
> <param name="allowScriptAccess" value="sameDomain" />
> <param name="movie" value="/swf/header.swf" />
> <param name="quality" value="high" />
> <param name="bgcolor" value="#ffffff" />
> <h1><a href="/">Generic Corp</a></h1>
> </object>
>
> Simply put, when a browser goes to print, or provides a print preview, I
> want it to ignore the object element completely, in favour of the h1
> element inside of the object (the object's alternative, or "graceful
> degradation" content).
>
> That is, I *DO NOT* want the object element to show up on either the
> print preview, or the actual print output at all. It should be as if the
> object element doesn't even exist. However, I *DO* want the object's
> "graceful degradation" content, the h1 (present for those who do not
> have Flash installed) to show up in the print preview AND the print output.
>
> TIA.
> ...Geshel
> --
> *********************************************************************
> My return e-mail address is an automatically monitored spam honeypot.
> Do not send e-mail there unless you wish to be reported as a spammer.
> Please send all e-mail to my first name at my last name dot org, with
> a subject-line of "NEWSGROUP REPLY FOR NEO GESHEL" (all uppercase).
> *********************************************************************

Your approach does not seem to work in adding the header within the
object. I added a header to my second example in both the IE and non-
IE path. The only browser I have that does not support flash is the
W3C Amaya. When viewed on it, nothing shows as if the flash objects
were not there at all. This tests only the non-IE path. I described
earlier how printing responds to a flash object. It could be that the
added header would work on an ActiveX object as used in the IE path,
but I have no browser with full ActiveX support without flash to view
the page - that would be an IE browser or close relative. Even if it
does work, that would still leave a problem for the non-IE browsers.

I suggest that you make a second page that appears as you want it for
printing out. Then just link to it from the main page for those who
want to print. The print page would have your header instead of the
flash display, and anything else that would make the printed page look
better. I have done this in the past for some of my pages that present
problems in printing rather than go to elaborate means to revise the
page for both viewing and printing. This method is quite common. For
example, Yahoo email has a print view button that reformats the page
for better printing of the eMail. Since server disc space is now dirt
cheap, a bit more size for the added page is of no concern.

I would not be much concerned about browsers that do not have flash.
The reason so many major sites are now using flash is that more OSs
and browsers support it than other players such as as WMP, Real, etc.
Flash can be installed on many more OSs than can WMP, for example. In
fact, if you buy a new computer, you likely will have to go to
considerable trouble to uninstall flash, and the average computer user
likely will never bother to do so. This has been so for several years.
Flash is not my favorite format for high quality video, but I can see
why it is so often used on large web sites designed to be viewed by
the masses.

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация