Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

9: FLASH, VIDEO & AUDIO > EXAMPLE FLASH, VIDEO & AUDIO

EXAMPLE FLASH, VIDEO & AUDIO

This example uses HTML5 to show a video.

The video has been encoded in H264 and WebM formats to reach as many browsers as possible. A Flash player has been added to the page for browsers that do not support HTML5 video. The Flash player is embedded using SWFObject. If the browser does not support HTML5 video or Flash, then a plain text message will be shown to the user.

<!DOCTYPE html>
<html>
  <head>
    <title>Flash, Video and Audio</title>
    <script type=“text/javascript”
      src=“http://ajax.googleapis.com/ajax/libs/
      swfobject/2.2/swfobject.js”></script>
    <script type=“text/javascript”>
      var flashvars = {};
      var params = {movie: “../video/puppy.flv”};
      swfobject.embedSWFC'flash/osplayer.swf”, “snow”,
      “400”, “320”, “8.0.0”, flashvars, params);</script>
  </head>
  <body>
    <video poster=“images/puppy.jpg” width=“400”
      height=“320” controls=“controls”>
      <source src=“video/puppy.mp4” type='video/mp4;
        codecs=“avc1.42E01E, mp4a.40.2”' />
      <source src=“video/puppy.webm” type='video/webm;
        codecs=“vp8, vorbis”' />
      <div id=“snow”>
       ....

  

You are currently reading a PREVIEW of this book.

                                                                                                                    

Get instant access to over $1 million worth of books and videos.

  

Start a Free Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint