Video and Audio Flashcards
Why is Flash less popular now for websites and videos?
- Emergence of javascript libraries that support animation
- Flash does not met accessibility requirements
- Emergence of native browser support (video and audio)
How would we add a flash video to a page
Generally done via Javascript
<code></code>
</code>
We will also need a flash video player . An open source one is osplayer
Then we call the swfobject and it’s method embedSWF
<code></code>
var flashvars = {}; var params = [movie:"../video/bird.flv"] swfobject.embedSWF("flash/osplayer.swf", "bird", "400", "300", "8.0.0", flashers, params);
</code>
The parameters for the method go like this:
video to play, id value of the element that the video should replace, width and height in pixels, min flash player
What video formats do browsers support?
H264: IE and Safari
WebM: Androis, Chrome, Firefox, Opera
What’s the tag options for adding video
Other options
preload: none | auto | metadata
autoplay
What if I need to include videos in multiple formats
You can use a source tag inside the video tag
What audio formats do browsers support
MP3: Safari, Chrome, IE
Ogg Vorbis: Firefox, Chrome, Opera
How do I add audio to a page
Also takes
preload: none | auto | metadata
loop
What do I need to do include different audio formats
Use the source tag