Đang chuẩn bị liên kết để tải về tài liệu:
html5 designing rich internet applications visualizing the web phần 7

Đang chuẩn bị nút TẢI XUỐNG, xin hãy chờ

Ví dụ, bạn có thể thêm một cái đầu phát lại để theo dõi bạn đang ở đâu trong đoạn video, chuyển tiếp, và tua lại cũng. Bạn có thể thấy một ví dụ về hỗ trợ video HTML5 với các điều khiển tùy chỉnh tại YouTube ). Không có nghi ngờ rằng các công cụ để nhanh chóng tạo ra các giao diện và chủ đề cho người chơi video sẽ được phát triể | 186 HTML5 RICH MEDIA FOUNDATION br a href onClick if video.paused video.play else video.pause Play Pause a p body html There are other controls you can add to your VIDEO element. For instance you can add a playback head to track where you are in the video fast forward and rewind as well. You can see an example of HTML5 video support with custom controls at YouTube http www.youtube.com html5 see also Figure 4.8 . There is no doubt that as the HTML5 VIDEO element matures tools to quickly create skins and themes for video players will be developed. Figure 4.8 YouTube s experimental HTML5 video page. Controlling Audio with AUDIO Tags Audio can be controlled in exactly the same way as video in HTML5. Leveraging the new AUDIO element you can embed audio files directly into your web page. Again as with the VIDEO element the process of embedding audio into your web page is very easy. In order to embed audio into your web page you need either an MP3 AAC or Ogg Theora-formatted audio file. audio autoplay controls source src sample.mp3 audio HTML5 RICH MEDIA FOUNDATION 187 Figure 4.9 The playback controls for AUDIO are the same as those for VIDEO. In the previous code the AUDIO element has the autoplay and controls attributes added. You will see in Figure 4.9 that the controls are stripped-down versions of the AUDIO element controls. As with the VIDEO element controls there is nothing too fancy. As with video you can control the audio playing back using JavaScript and some CSS. Let s start with using JavaScript before we make everything look pretty with CSS. The first step is to create the base web page. The following HTML should be getting familiar to you. DOCTYPE HTML html head title Audio in HTML5 title head body body html Now let s add the AUDIO element between the BODY elements. audio source src sample.mp3 audio You will see from the HTML code that the AUDIO element does not have any attributes. The autoplay and controls attributes have been removed. If you preview this

Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.