HTML5 Guidelines for Web Developers
86 Chapter 4—Video and Audio 4.7 Video and Scripting—A Simple Video Player Not only can you display videos in the browser, you c ...
4.7 Video and Scripting—A Simple Video Player 87 The video player’s HTML page with JavaScript library and CSS styles can be foun ...
88 Chapter 4—Video and Audio z video.videoWidth = 428 (original width) z video.videoHeight = 240 (original height) z video.poste ...
4.7 Video and Scripting—A Simple Video Player 89 var playPause = function(ctrl) { if (video.paused) { video.play(); ctrl.value = ...
90 Chapter 4—Video and Audio curPos = document.getElementById("currentPosition"); curPos.max = video.duration; This now gives ma ...
4.7 Video and Scripting—A Simple Video Player 91 Listing 4.1 Change and update playback position var updateProgress = function(c ...
92 Chapter 4—Video and Audio The JavaScript callback fastFwdBwb() is rather short and looks like this: var fastFwdBwd = function ...
4.7 Video and Scripting—A Simple Video Player 93 var playPause = function() { if (video.paused) { _play(); } else { _pause(); } ...
94 Chapter 4—Video and Audio The mute() function uses the read/write attribute video.muted to switch to mute or loud, depending ...
4.7 Video and Scripting—A Simple Video Player 95 4.7.8 Other Attributes and Methods of the “HTMLMediaElement” Interface All medi ...
96 Chapter 4—Video and Audio As simple as this example may seem, the processes during loading a media stream are actually rather ...
4.7 Video and Scripting—A Simple Video Player 97 The attribute readyState describes which state a media element is currently in. ...
98 Chapter 4—Video and Audio We have nearly reached the end of our journey through the HTMLMediaElement inter- face. The remaini ...
4.8 And What About Audio? 99 In the network state, we encounter loadstart, progress, suspend, abort, error, emptied, and stalled ...
100 Chapter 4—Video and Audio Figure 4.10 Screen shot of the JavaScript HTML5 audio player The individual tracks were extracted ...
4.8 And What About Audio? 101 Let’s start with the audio element: <audio src="music/bbb_01_intro.ogg" oncanplay="canPlay()" o ...
102 Chapter 4—Video and Audio To gain a better understanding of the audio player’s structure and functionality, look at the HTML ...
4.8 And What About Audio? 103 loadTrack() is called in various ways. First, when changing tracks directly in the menu via the on ...
104 Chapter 4—Video and Audio As the first line of the function indicates, the status is determined by the button element’s clas ...
Summary 105 At this point we have not only completed our audio player, but also reached the end of the chapter on video and audi ...
«
1
2
3
4
5
6
7
8
9
10
»
Free download pdf