Stylehack

YouTube Movies and Valid (X)HTML - Part 3 of 3

This is the final entry in a series of 3 articles designed to help you embed a YouTube movie while maintaining (X)HTML standards compliance, then customizing the display of the movie and finally, providing alternate content for visitors unable to view the movie.

In this article we’ll add alternate content to the code that was modified in the first two articles. The purpose of providing alternate content is to allow for accessibility and/or for visitors whose browser is not configured to display a movie.

What is Alternate Content?

Alternate content is simply text or other content (for instance, an image) provided as an alternate representation of the object embedded within the page.

  1. It is placed between the <object> </object> tag set, after any <param> elements and before the </object> tag.
  2. There is no tag set or attribute label related to this content, it is placed directing into the <object> tag set just like placing content in a <p> tag set!
  3. The alternate content is what will be displayed in the browser when your visitor does not have the capability to view the object being called by the <object> element.

You can use an image, add a link, even use other elements in the alternate content… anything that is valid under (X)HTML coding guidelines. It’s actually a nice touch to use all of the above – an image, a link and text – for maximum accessibility.

Read the entire article »

Opera 8.5 is here… and it’s FREE!

BIG NEWS: Opera has removed all banners and is offering the Opera Web Browser for desktops free of licensing fees! Get your copy now at http://opera.com/free/! Quote from Opera: ‘Opera has removed the banners, found within our browser, and the licensing fee. Opera’s growth, due to tremendous worldwide customer support, has made todays milestone an achievable goal. Premium support is available.’ Note: If you purchased Opera in the last 30 days you can get a full refund! Why Opera? There are many reasons, so I’ll try to limit myself to a what I consider a few key points:

General Use

  • built-in pop-up blocker
  • excellent bookmark management features
  • store a series of web pages in sessions instead of individual bookmarks, then open them all at once
  • reopen pages you just closed with one click of a button
  • search from the address bar (ex: ‘g mysearchterm’ displays the results of a Google search)
  • change settings on-the-fly — no need to close/re-open
  • built-in note taking function
  • built-in password manager
  • built-in download manager/panel which doesn’t slow down your continued browsing
  • move menu bars, panels & buttons around at will
  • highly-configurable thru gui, not through text file hacks
  • no need to download/trust/install extensions from unknown authors
  • supports SVG
  • more standards compliant than any other browser

Accessibility

  • support for portions of Aural CSS
  • mouse gestures built-in
  • extensive keyboard control
  • extensive, easily customizable keyboard shortcuts (my favorite is using Z and X to move forward/backward thru pages I’ve visited)
  • easily disable or change page styles for improved readability (custom or use pre-defined)
  • true page zooming at the touch of a key (enlarges both text and images)

Geekier Toys

  • built-in RSS reader
  • built-in IRC chat
  • built-in bit torrent client
  • built-in searchable, email client (similar to gmail - I put that here because I use ~gasp~ Thunderbird - old dog, no new tricks scenario)
Basically, it comes “out of the box”, ready to go and requires much less fiddling around with it to make it operate the way I prefer. All in less than 4MB… and REALLY, REALLY FAST! More info from Opera on browser features is at http://www.opera.com/docs/specs/ A well-written user review can be found at http://slashdot.org/comments.pl?sid=162788&threshold=1&commentsort=0&tid=95&mode=thread&cid=13603510 Go get it! That’s an order. “-) http://opera.com/free/

XHTML Validation & Flash Movies

One of the hurdles Web Coding Standaristas place in a Flash Animator’s path is that of validation — the way that Flash movies have historically been inserted into web pages does not conform to current W3C standards. Boo hoo. “-) A couple of years ago I stumbled across the article on ALA re the Satay Method of inserting a Flash movie so that the page will still validate. It was a great article, contained a plethora of information on who/what/when/where/why and how the author had arrived at the method as it was explained at that time, and where the author felt it still needed work. To my mind the operative word was “work”… there was too much of it involved. If the visitor can find my site/page, he/she can accept some responsibility for taking the extra steps necessary to view all the content if it’s really that important to them. So I decided then and there to get rid of all the extra “stuff” in the Satay post and use only the bare basics that I felt were necessary to meet some specific considerations:
1. Valid coding practice 2. Meet basic Accessibility Standards 3. Provide a solution to the visitor without the Flash plugin or who has (gasp) blocked the play of Flash animation
Mostly, though, I decided to do this to impress and awe my pal Farron. She’s a web standards worshipper.. er I mean Web Standards Coding Instructor [whipping head around in fear to make sure she's not reading this!]. “Impress and awe” is defined in Stylehack-speak as “Prove it can be done”. “-) Selecting the level of Standards To cover future bases as much as possible, I decided to aim for validating to XHTML 1.0 Strict. The same practices will work at other levels… XHTML 1.0 Trans and I think HTML 4.01 also, though it’s been so long since I coded that way I could be wrong. Here is the DOCTYPE declaration for an XHTML 1.0 Strict document:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
	   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
You’ll notice I left off the XML declaration… I’ve had trouble with it tossing one browser or another into Quirks mode, so I include it only sparingly.
<?xml version="1.0" encoding="iso-8859-1"?>
Defining the OBJECT Tag There are many great discussions and how-tos on the web that discuss the merits of just about every topic, including the use of the OBJECT tag that is used to insert a Flash animation. So I’m not going to go into that here, I’m simply going to give you an example of how I insert a movie and explain my logic (or lack thereof).
1 <object type="application/x-shockwave-flash" data="myMovie.swf" width="431" height="68">
2 <param name="movie" value="myMovie.swf" />
3 <param name="BGCOLOR" value="#000000" />
4 <a title="You must install the Flash Plugin for your Browser in order to view this movie"  href="http://www.macromedia.com/shockwave/download/alternates/"><img src="needplugin.gif" width="431" height="68"  alt="placeholder for flash movie" /></a>
5 </object>
Note: The above code example should not have a hard return in it breaking what was one line into many lines (line 4); this example was allowed to wrap for purposes of presentation, so there you go. Obviously, it will not have actual line numbers when you recreate it. “-)
Line 1:  The only variables on this line are the name of your movie and its dimensions. Do NOT remove the ” (apostrophes) around the name of the movie nor its dimensions; Line 2:  This param (Name) is required for cross-browser compatibility. (Don’t get me started on my IE-is-bad and FF-is-the-IE-of-Geek-Wannabes rant! Good thing I shut off comments here. grin) Anyway, the name you put here must match the name in Line 1. Again, don’t remove the ” (apostrophes);
Note: Lines 1 and 2 replace the old OBJECT/EMBED combo used to address how various browsers have accessed Flash movies in the past.
Line 3:  An optional line; there could actually be more params used than are used in this example, any that are considered valid for the OBJECT tag can be defined as necessary and applicable; Line 4:  This is the line that addresses missing plugins, browsers where animation is shut off and older browsers that can’t do the Flash movie thing. On top of which, it adds a level of accessibility to your movie for visitors using a Text Reader. It’s a work of art. “-) Basically, you need 3 things here….
a) An image to replace your movie. It can be a screen shot of your movie, or an image that informs the viewer they need a plugin to view the movie. To prevent any problems with your page design, you should make this image the same size as the movie; b) A destination URL where your visitors can get the Flash plugin, if necessary. In the example above, I have used the link to the page on the Macromedia site that offers download links for plugins to fit a variety of operating systems and/or browsers. These links change from time to time, so you need to remember to check them every now and then. Another option would be to make this link to a page on your site that then offers a link to Macromedia; if you have a lot of movies on your site, it would be easier to update the link on that page rather than a bunch of static page links. Of course, if you use a dynamic method of site generation, like PHP, this could be a variable so you only have to change a single declaration to impact your site. I’m getting offtopic, right? “-) c) Appropriate ALT and TITLE tags for your page, both for accessibility and clarity.
The implementation of these 3 items is EaSy PeAsY, as debbieT says! Simply wrap the image in an A tag (hyperlink). See? That wasn’t hard at all. Why do it?   When a visitor doesn’t have the Flash player (or has shut off Flash animation) their browser will display the image declared in this line. When they roll their mouse cursor over the image, the TITLE will pop up so they can read your instructions/comments. If they have images shut off, they will also see the ALT tag. Clicking on the image/link will send them to the Macromedia site so they can get the appropriate plugin. Whether you use an image with words (”You need the Flash Player to see my movie!”) or a screen capture of your movie, you need to be sure to use clearly thought out TITLE and ALT text. This is good practice for you for accessibility purposes… they should not be the same, but should work together in some way to describe an object or — in this case — also pass on information. Line 5:  Don’t forget to close the OBJECT tag. Summary Believe it or not, this is all you need! The movie plays or the image is displayed. And best of all, it validates as XHTML 1.0 Strict! Of course, you will have to insert this bit of code into a valid structure… it can be put in a DIV or a P, for instance. Please keep in mind that if you are using Flash MX 2004 and that blasted sniffer publishing method, you will need to fiddle this information a bit. I personally don’t like sniffers, so that’s not an issue for me. What’s that?  You want to know if there is an easy way to gather the info about your movie and the params you normally used? Sure! Simply do the Flash export/publish to HTML thing, then use that as a source of info to create your own OBJECT tag in your page. Slacker’s Rule #472. “-) And that concludes today’s Blah blah, car ride. (What another of daHens — Butzi — calls my “discussions”. hehe) Footnote 1: There are several geniuses who have come up with this stripped down method in the last year and wrote it up on their blogs; this article is not based on their publishing. I was using it long before they “published” and simply put off writing it up for our Flash and Swish classes - not to mention the Build a Website classes - because I am ~The~ Slacker! Just for the record. Footnote 2: This method is not recommended for a gigantic movie without a proper preloader sequence and planning, nor is it the best way to handle streaming Flash animations. For that, there is another trick that is part of the complete Satay Method using a 1×1 empty movie as a sniffer. Footnote 3: Farron’s blog is called Catartis. I only referenced her “other” site above because I wanted to harrass her a bit. hehe. For the record, the other daHens (Butzi, debbieT and Liann - in alphabetical order) are available by link up on the right.

Stylehack © 2008 - Becky Peters :: All Rights Reserved
Powered by WordPress