Recent Changes - Search:

Web Design

This website demonstrates using wikis as teaching and learning tool.

The course instructor is happy to share the teaching materials here with those who find it readable.

Web Multimedia

A Web Design Lecture by Steven Choy

Overview: Sound formats - Video formats - Browser supports for multimedia - Object Elements - Use Flash object to embed MP3 - Use JavaScript to embed multimedia


Introduction

  • Multimedia is pictures, sound, music, animations, and videos.
  • Modern web browsers have support for many multimedia formats.
  • Multimedia Formats
Multimedia elements are stored in media files with different extensions.
  • Browser Support
The support for sounds, animations and videos is handled in different ways by different browsers. Some elements can be handled inline, some requires a plug-in and some requires an ActiveX control.

Sound Formats

  • The MIDI Format - .mid or .midi
The MIDI (Musical Instrument Digital Interface) is a format for storing a set of digital musical instructions that can be interpreted by your computer.
Sounds stored in the MIDI format have the extension .mid or .midi.
Downside: it stores only tunes; it cannot store songs or record sounds.
Upside: its file size is extremely small
  • The RealAudio Format - .rm or .ram
The RealAudio format is a proprietary audio format developed by RealNetworks.
It allows streaming of audio with low bandwidths; its quality is often reduced.
It have the extension .rm or .ram.
  • The AU Format - .au
The Au file format is a simple audio file format introduced by Sun Microsystems.
It is supported by many software over a large range of platforms.
It has the extension .au.
  • The WAVE Format - .wav
The WAVE (waveform) format is supported by Windows and by most web browsers.
Sounds stored in the WAVE format have the extension .wav.
  • THe MP3 Format - .mp3 or .mpga
MP3 is one of the most popular sound formats for music recording.
Sounds stored in the MP3 format have the extension .mp3, or .mpga (for MPG Audio).

Video on the Web

  • The file format that holds the video
  • The video encoding format
  • The player that plays the video on the web page

Video File Formats

  • This is often called a container format.
  • Examples: .mp4, .flv, .avi, f4v, .ogv.
  • .mp4 is a file format, which can hold either MPEG-4 or H.264 video,

Video Encoding Formats

  • This is often called a codec
  • Examples: H.264, VP6, MPEG-4, VP8, Theora

Video players for the Web

  • Differents video players support different file formats and ecnoding formats.
  • 3 different tyeps:
    • Use Helper applications: the browser launches a plugin-in to play the video
    • Use Flash player: the browser runs a Flash object that can get and play the video
    • Native support by the browser

How to get the video played onto your website?

  • HTML5 <video> tag (It only works in new browsers)
HTML5 defines a standard way to embed video content in your web sites: through the video tag.
      <video src="mymovie.mp4" width="320" height="240" controls="">
      </video>
HTML5 Supported Video
      (file format = video stream + audio stream)
      .mp4 = H.264 + AAC
      .ogg/.ogv = Theora + Vorbis
      .webm = VP8 + Vorbis
  • HTML <object> tag
    <object attr1="xxx" attr2="yyy" attr3="zzz">
      <param name="name1" value="value1" >
      <param name="name2" value="value2" >
      <param name="name3" value="value3" >
    </object>
  • HTML <embed> tag
      <embed attr1="xxx" attr2="yyy" attr3="zzz">
      </embed>
The <embed> tag is deprecated. The World Wide Web Consortium (W3C) recommend using the <object> tag instead.

Object Elements

  • The object element supports pictures, sounds, videos and other objects.
  • Image as object
        <object height="100%" width="100%"
          type="image/jpeg" data="audi.jpeg">
        </object>
  • Web page as object
        <object type="text/html" height="100%" width="100%"
        data="http://www.stepwise.hk/">
        </object>
  • Display a sound/video to be played
        <object
        classid="clsid:22D6F312-B0F6-11D0-94AB-0080C74C7E95">
        <param name="FileName" value="liar.wav" />
        </object>
  • Display a flash
      <object width="400" height="40"
        classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
        codebase="http://fpdownload.macromedia.com/
          pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0">
      <param name="SRC" value="bookmark.swf">
      <embed src="bookmark.swf" width="400" height="40"></embed>
      </object>
  • Display QuickTime Movies
      <object width="160" height="144"
      classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B"
      codebase="http://www.apple.com/qtactivex/qtplugin.cab">
      <param name="src" value="sample.mov">
      <param name="autoplay" value="true">
      <param name="controller" value="false">
      <embed src="sample.mov" width="160" height="144"
      autoplay="true" controller="false"
      pluginspage="http://www.apple.com/quicktime/download/">
      </embed>
      </object>
  • Display Real Video Movies
      <object width="320" height="240"
      classid="clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA">
      <param name="controls" value="ImageWindow" />
      <param name="autostart" value="true" />
      <param name="src" value="male.ram" />
      </object>
  • The classid attribute uniquely identifies the player software to use.
  • The codebase attribute specifies the base path used to resolve relative URIs specified by the classid, data, and archive attributes. When absent, its default value is the base URI of the current document.
  • The embed element is supported by old browsers.

Example web pages

<object id="MediaPlayer" classid="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6" codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,5,715" type="application/x-oleobject" align="absmiddle" height="68" width="320">
<param name="ShowControls" value="1">
<param name="ShowPositionControls" value="1">
<param name="ShowTracker" value="1">
<param name="ShowStatusBar" value="1">
<param name="stretchToFit" value="false">
<param name="AutoSize" value="1">
<param name="Url" value="http://www.rthk.org.hk/live1.asx">
<embed type="application/x-mplayer2" pluginspage="http://www.microsoft.com/Windows/Downloads/Contents/Products/MediaPlayer/" src="http://www.rthk.org.hk/live1.asx" ;="" showstatusbar="1" showcontrols="1" stretchtofit="0" showpositioncontrols="1" showtracker="1" autosize="1" align="absmiddle" height="68" width="320"></object>
<object id="RVOCX" classid="clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA" height="66" width="320">
<param name="SRC" value="http://www.rthk.org.hk/live1.ram">
<param name="CONTROLS" value="All">
<param name="CONSOLE" value="one">
<param name="AUTOSTART" value="true">
<embed src="http://www.rthk.org.hk/live1.ram" nojava="true" controls="All" console="one" autostart="true" height="66" width="320">
</object>
<object id="MediaPlayer" classid="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6" codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,5,715" type="application/x-oleobject" align="absmiddle" height="284" width="384">
<param name="ShowControls" value="1">
<param name="ShowPositionControls" value="1">
<param name="ShowTracker" value="1">
<param name="ShowStatusBar" value="1">
<param name="stretchToFit" value="false">
<param name="AutoSize" value="1">
<param name="Url" value="http://www.rthk.org.hk/asx/rthk/tv/worldreview09/20091231.asx">
<embed type="application/x-mplayer2" pluginspage="http://www.microsoft.com/Windows/Downloads/Contents/Products/MediaPlayer/" src="http://www.rthk.org.hk/asx/rthk/tv/worldreview09/20091231.asx" ;="" showstatusbar="1" showcontrols="1" stretchtofit="0" showpositioncontrols="1" showtracker="1" autosize="1" align="absmiddle" height="284" width="384"></object>
<object style="visibility: visible;" id="flash-game" data="http://www.flashgame.com.hk/games/f593n9.swf" type="application/x-shockwave-flash" height="430" width="570 "></object>
<object class="player" width="480" height="360">
<param name="movie" value="http://www.youtube.com/v/n-OEXqfaMys?f=videos&app=youtube_gdata&autoplay=1&rel=0&color1=0xb27217&color2=0xdeb154&border=1"></param>
<param name="wmode" value="transparent"></param>
<embed class="player" src="http://www.youtube.com/v/n-OEXqfaMys?f=videos&app=youtube_gdata&autoplay=1&rel=0&color1=0xb27217&color2=0xdeb154&border=1" type="application/x-shockwave-flash" wmode="transparent" width=480" height="360"></embed>
</object>

Use Flash object to embed MP3

  • Google Reader MP3 Player
"Google Reader has an inbuilt MP3 player that is pretty much the same as Gmail player but it also works on non-Google websites. This player has volume controls, no Google branding and it auto-detects the duration of the music file so your readers know how long the song will last."
    <embed 
      type="application/x-shockwave-flash"
      flashvars="audioUrl=MP3_FILE_URL"
      src="http://www.google.com/reader/ui/3523697345-audio-player.swf"
      width="400" height="27"
      quality="best">
    </embed>
  • Class discussion: what's the advantages of using Flash object to play audio?

Use JavaScript to embed multimedia

"If you maintain an MP3 blog or run a podcast and regularly link to MP3 files, it makes little sense to embed a separate Flash player with every MP3 file. I would therefore recommend using the Yahoo! Media Player that auto-detects links to MP3 files in your web pages and creates an embedded player for each link."
Example code:
      <a href="example1.mp3">My first song</a>
      <a href="example2.mp3">My second song</a>
      <script type=”text/javascript” src=”http://mediaplayer.yahoo.com/js”></script>
  • jQuery lightbox for images and videos
  • How to view the embedded source? (for class demonstration)
  • How to use JavaScript to embed multimedia (for class demonstration)

Showcase: Creative use of video in Web design

  • UNIQLOCK: It is an advertising campaign for Uniqlo, one of Japan’s largest casual wear retailers.
  • I Surf Because: It is part of Billabong’s digital marketing campaign.

References and Resources


Thanks for Reading

If you would rather like to have this lecture note in printed format, please click the print action link in the top right corner.

If you find any problem in this lecture note, please feel free to tell Steven via steven [at] findaway.hk.

Edit - History - Print - Recent Changes - Search
Page last modified on October 13, 2011, at 10:35 AM