|
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. |
Lecture /
Web MultimediaA 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 elements are stored in media files with different extensions.
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 (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 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 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 (waveform) format is supported by Windows and by most web browsers.
Sounds stored in the WAVE format have the extension .wav.
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
Video File Formats
Video Encoding Formats
Video players for the Web
How to get the video played onto your website?
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
<object attr1="xxx" attr2="yyy" attr3="zzz">
<param name="name1" value="value1" >
<param name="name2" value="value2" >
<param name="name3" value="value3" >
</object>
<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
<object height="100%" width="100%"
type="image/jpeg" data="audi.jpeg">
</object>
<object type="text/html" height="100%" width="100%"
data="http://www.stepwise.hk/">
</object>
<object
classid="clsid:22D6F312-B0F6-11D0-94AB-0080C74C7E95">
<param name="FileName" value="liar.wav" />
</object>
<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>
<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>
<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>
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 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>
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>
Showcase: Creative use of video in Web design
References and Resources
Thanks for ReadingIf 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. |