Lecture 6
Lecture 6
autoplay="autoplay"
controls="controls"
loop="loop"
src="url"
Digital video
• Video files are composed of a series of single images
called frames
• Many frames are sized to have width-to-height ratios or
aspect ratios of 4:3, though theatrical releases typically
have aspect ratios of 1.85:1 or 2.39:1
• The video bit rate is the amount of data that has to be
processed by the video player each second
• The number of frames shown in a period of time is the
frame rate
• The two most popular video formats are Flash video (.flv)
and MP4 (.mp4).
Adding video
To add a video clip, we use the video element:
<video>
<source src="url1">
<source src="url2">
</video>
where url1, url2, etc. are the possible sources
of the video clip.
Adding video
The following are self-explanatory attributes for the
video element:
audio="muted"
autoplay="autoplay"
controls="controls"
loop="loop"
src="url"
height="value"
width="value"
Videos from YouTube
YouTube videos are embedded using either the YouTube
Shockwave Flash player file (.swf) or a video player.
<object width="value" height="value">
<param name="movie" value="url">
more parameters
<embed src="url"
type="application/x-shockwave-flash"
width="value" height="value" more parameters>
</object>
Java
• A system called Oak
was developed by Sun
Microsystems as an
operating system
intended to be used by
common appliances
and devices
• Oak was renamed Java
in 1995
• Each Java program
works with a Java
Virtual Machine (JVM)
Java applets
• Applets are displayed as embedded objects on
a Web page
• Several libraries of Java applets are available
• The popularity of Java has declined in recent
years as more and more of its features can be
duplicated with Flash or JavaScript
• The programming enhancements provided
with HTML5 will result in an even more
reduced need for Java
Java applets
To embed a Java applet, use the object element
<object type="application/x-java-applet"
width="value" height="value">
<param name="code" value="url">
more parameters
</object>
where the width and height attributes define the dimensions of
the applet window, url specifies the location and filename of the
Java file, and parameters represents the parameters associated
with running the applet.