LEARN THE QUICK AND EASY WAY! VISUAL QUICKSTART GUIDE HTML and CSS 8th Edition Chapter 17: Video, Audio, and Other MultiMedia.

Slides:



Advertisements
Similar presentations
HTML Basics Customizing your site using the basics of HTML.
Advertisements

What is Multimedia ? Multi ( Multiple ) and Media ! So…. Information in multiple formats, including text, images, audio, video and animation :) It makes.
1 HTML5 Audio and Video Credits: Dr. Jay Urbain
Using Multimedia on the Web Enhancing a Web Site with Sound, Video, and Applets.
CNIT 132 – Week 9 Multimedia. Working with Multimedia Bandwidth is a measure of the amount of data that can be sent through a communication pipeline each.
HTML5, OVERVIEW AND NEW FEATURES PowerPoint by Mason O’Mara.
HTML5 Media API.
Iframes & Images Using HTML.
More CSS - Page layout + HTML5 new features Boriana Koleva Room: C54
HTML 5 and CSS 3, Illustrated Complete Unit K: Incorporating Video and Audio.
Neal Stublen Pre-HTML5 Solutions  Audio and video were embedded in pages using plug-ins Apple Quicktime Microsoft Silverlight Adobe.
UNIT K: INCORPORATING VIDEO AND AUDIO 1 Encoding: the process of transforming moving image and/or sound into a digital file. Each encoding method known.
HTML5 Application Development Fundamentals
INF Web Design Using Multimedia on the Web Video - Part 1.
Macromedia Dreamweaver 4 Advanced Level Course. Add Rollovers Rollovers or mouseovers are possibly the most popular effects used in designing Web pages.
Chapter 15 HTML 5 Video and Audio Intro to HTML5 1.
Chapter 14 Introduction to HTML
ITIS 1210 Introduction to Web-Based Information Systems Chapter 41 How Animation on the Web Works.
Audio and Video on the Web Sec 5-12 Part or all of this lesson was adapted from the University of Washington’s “Web Design & Development I” Course materials.
LEARN THE QUICK AND EASY WAY! VISUAL QUICKSTART GUIDE HTML and CSS 8th Edition Chapter 2: Working with Webpage Files.
Session: 11. © Aptech Ltd. 2HTML5 Audio and Video / Session 11  Describe the need for multimedia in HTML5  List the supported media types in HTML5 
Chapter 11 Adding Media and Interactivity. Flash is a software program that allows you to create low-bandwidth, high-quality animations and interactive.
© 2011 Delmar, Cengage Learning Chapter 11 Adding Media and Interactivity with Flash and Spry.
Video on the Web. The Evolution of web video formats… WebM (Supported by Google) Ogg (Supported by Theora) Mp4 (h264 video encoding) WebM (Supported by.
CHAPTER 18 INTEGRATING AUDIO AND VIDEO. LEARNING OBJECTIVES How the HTML 5 and tag pair can be used to include a video file within a webpage How video.
HTML5. What is HTML5? HTML5 will be the new standard for HTML. HTML5 is the next generation of HTML. HTML5 is still a work in progress. However, the major.
Week 5 HTML5 and Video + Web Fonts. Video and HTML5 Until now, there has not been a standard for showing a video/movie on a web page. In the past most.
Multimedia and Web Technology Prepared by: Asst. Prof. Maryam Eskandari.
© Cheltenham Computer Training 2001 Macromedia Dreamweaver 4 - Slide No 1 Macromedia Dreamweaver 4 Advanced Level Course.
Programming Games Show your cannonball. HTML5 video. Miro. Classwork/Homework: Acquire video, convert to multiple formats, and produce simple (just html)
CSCE Chapter 5 (Links, Images, & Multimedia) CSCE General Applications Programming Benito Mendoza 1 By Benito Mendoza Department.
Section 4.1 Format HTML tags Identify HTML guidelines Section 4.2 Organize Web site files and folder Use a text editor Use HTML tags and attributes Create.
LEARN THE QUICK AND EASY WAY! VISUAL QUICKSTART GUIDE HTML and CSS 8th Edition Chapter 6: Links.
Session: 1. © Aptech Ltd. 2Introduction to the Web / Session 1  Explain the evolution of HTML  Explain the page structure used by HTML  List the drawbacks.
HTML5 Audio and Video. Slide 2 History Playing audio and video used to be something of a novelty You would embed a control (with the element) into your.
PLUG INS flash, quicktime, java applets, etc. Browser Plug-ins Netscape wanted a method to extend features of the browser became an unofficial standard.
HTML 5 Tutorial Chapter 3 Video. Video HTML 5.0 provides a standard for showing video. Using the element we can easily embed video within our web page.
CHAPTER 15 HTML 5 VIDEO AND AUDIO Intro to HTML5 1.
HTML 5. Introduction In modern browsers, adding a video to your page is as easy as adding an image. No longer do you need to deal with special plug-ins.
LEARN THE QUICK AND EASY WAY! VISUAL QUICKSTART GUIDE HTML and CSS 8th Edition Chapter 8: Working with Style Sheets.
Sound and the Web. Transferring sound Download Progressive Download Stream.
2 If aliens came to this solar system and observed humans over the last several years, what would they think is the most significant benefits of the.
Objective: To describe the evolution of the Internet and the Web. Explain the need for web standards. Describe universal design. Identify benefits of accessible.
Chapter 11 Adding Media and Interactivity. Chapter 11 Lessons Introduction 1.Add and modify Flash objects 2.Add rollover images 3.Add behaviors 4.Add.
HTML (Advanced) -forms, iframe, audio, video. Outline – Forms – iFrames – Audio/Video.
CS 200 Multimedia Objects in Web Pages. MultiMedia Objects Three primary types of multimedia objects  Audio  Video Includes Flash Objects  Images.
Creating Web Pages with Links, Images, and Embedded Style Sheets
Chapter 8 Adding Multimedia Content to Web Pages HTML5 & CSS 7 th Edition.
INT222 – Internet Fundamentals Week 8: Using New HTML features 1.
CHAPTER 8 Multimedia 1. Using Multimedia ❖ Multimedia: the combination of text, sound, and video to express an idea or convey a message. ❖ Podcasts: a.
HTML5 and CSS3 Illustrated Unit F: Inserting and Working with Images.
M ULTIMEDIA ON THE W EB. Multimedia Purpose of Multimedia Multimedia Issues HTML5 and elements CSS Transitions and Animations Animation to avoid.
CHAPTER 10 AUDIO AND VIDEO. MEDIA PLAYER API HTML5 contains an API (Application Programming Interface) for controlling audio and video players embedded.
HTML Structure & syntax
Advanced HTML Tags:.
© 2016 Pearson Education, Inc., Hoboken, NJ. All rights reserved.
Chapter 9 HTML 5 Video and Audio
HOW FLASH WORKS The Flash authoring environment is used to create Flash movies The .fla file is exported to a format called .swf The .swf file is.
Chap 3. Audio/Video api.
Chapter 4: HTML5 Media - <video> & <audio>
HTML5 Level II Session II
Playing Audio (Part 2).
Audio and Video Chapter 10.
Essentials of Web Pages
Playing Audio (Part 1).
Playing Video (Part 2).
Playing Video (Part 1).
Client-Side Internet and Web Programming
Presentation transcript:

LEARN THE QUICK AND EASY WAY! VISUAL QUICKSTART GUIDE HTML and CSS 8th Edition Chapter 17: Video, Audio, and Other MultiMedia

LEARN THE QUICK AND EASY WAY! VISUAL QUICKSTART GUIDE Objectives Employ video and audio in a webpage. Manage how media files function in different browsers. Use video attributes and audio attributes. Include controls and autoplay in a video. Add loop, preload, and specify a poster image. Establish multiple video and audio sources. Create video and audio fallbacks.

LEARN THE QUICK AND EASY WAY! VISUAL QUICKSTART GUIDE Video, Audio, and Other MultiMedia Prior to HTML5, third-party plug-ins were the only method of adding multimedia to your webpages. –Adobe Flash Player or Apple’s QuickTime. HTML5 introduced native multimedia—where the browser takes care of it all. –Not all HTML5-capable browsers support the same video and audio formats.

LEARN THE QUICK AND EASY WAY! VISUAL QUICKSTART GUIDE Third-Party Plug-ins and Going Native Third-party plug-ins allowed audio and video before HTML5, but there were problems: –Code for embedding a Flash video in one browser didn’t necessarily work in another. –More importantly, browsers would slow down or crash. Native multimedia brings improved performance and stability, but there are drawbacks: –Media needs to be in more than one format to be playable by HTML5-capable browsers. –Embedding audio and video files means that the URLs to the source files are available to anyone who wants them.

LEARN THE QUICK AND EASY WAY! VISUAL QUICKSTART GUIDE Video File Formats Three video codecs supported by HTML5: –Ogg Theora uses either.ogg or.ogv file extension. Supported by Firefox 3.5+, Chrome 4+, Opera 10.5+, and Firefox for Android. –MP4 (H.264) uses the.mp4 or.m4v file extension. Supported by Safari 3.2+, Chrome 4-?, Internet Explorer 9+, iOS, Android 2.1+, Chrome for Android, Firefox for Android, and Opera Mobile 11+. –WebM uses the.webm file extension. Supported by Firefox 4+, Chrome 6+, Opera 10.6+, Android 2.3+, Chrome for Android, Firefox for Android, and Opera Mobile 14.

LEARN THE QUICK AND EASY WAY! VISUAL QUICKSTART GUIDE What's a Codec? Codec is a computer program that uses a compression algorithm to encode and decode a digital stream of data, making it more suitable for playback. –A codec aims to maintain highest audio and video quality it can with a smaller file size.

LEARN THE QUICK AND EASY WAY! VISUAL QUICKSTART GUIDE Setting the MIME Type Some browsers may not play media files unless they are served as the proper MIME type. If your site is on the Apache web server, configure MIME types in the.htaccess file, a text file that typically resides in the root directory of your site. –Here are MIME types to add to your.htaccess file: AddType video/ogg.ogv AddType video/mp4.mp4 AddType video/webm.webm AddType audio/ogg.ogg AddType audio/mp3.mp3

LEARN THE QUICK AND EASY WAY! VISUAL QUICKSTART GUIDE Adding A Video to Your Webpage Video element adds a video to your webpage. –Browsers will figure out your video’s dimensions when it loads the file and display it at that size, or you can set them yourself.

LEARN THE QUICK AND EASY WAY! VISUAL QUICKSTART GUIDE To Add a Video to Your Webpage Obtain your video resource. Type –myVideo.ext is location, name, and extension of video file.

LEARN THE QUICK AND EASY WAY! VISUAL QUICKSTART GUIDE Exploring Video Attributes Attributes that can be use with video element: –Src: Specifies URL to video file. –Autoplay: Automatically starts playing video. –Controls: Adds the browser's default control set to the video. –Muted: Mutes video's audio (not supported by any browser). –Loop: Plays the video in a loop. –Poster: Specifies image file to display when it loads.

LEARN THE QUICK AND EASY WAY! VISUAL QUICKSTART GUIDE Exploring Video Attributes Attributes that can be use with video element: –Width: Width of the video in pixels. –Height: Height of the video in pixels. –Preload: Hints to browser how much video to load. Takes three different values: –None: Doesn’t load anything. –Metadata: Loads only the video’s metadata (e.g., length and dimensions). –Auto: Lets the browser decide what to do (this is the default setting).

LEARN THE QUICK AND EASY WAY! VISUAL QUICKSTART GUIDE Adding Controls and Autoplay to Your Video Controls attribute informs the browser to add a set of default controls to the video. Each browser has its own default controls. Boolean attributes, such as controls, don't need to have a value specified for them.

LEARN THE QUICK AND EASY WAY! VISUAL QUICKSTART GUIDE Video Controls in IE10 and Opera

LEARN THE QUICK AND EASY WAY! VISUAL QUICKSTART GUIDE When a Video Format Isn’t Supported If the browser you use doesn’t support the video file format you’re using, it will show its controls bar and either an empty, white rectangle or the poster image. Safari does not support WebM.

LEARN THE QUICK AND EASY WAY! VISUAL QUICKSTART GUIDE To Add Controls and Autoplay to a Video To add controls to a video: –Type my-video.ext points to your video file. To add autoplay to a video: –Type my-video.ext points to your video file.

LEARN THE QUICK AND EASY WAY! VISUAL QUICKSTART GUIDE Looping a Video and Specifying a Poster Image Loop attribute is use with autoplay to set video to play automatically and continuously until stopped. Poster image specifies image to display on loading.

LEARN THE QUICK AND EASY WAY! VISUAL QUICKSTART GUIDE To Loop a Video and Specify a Poster Image To add autoplay and loop a video: –Type, where my-video.ext points to your video file. To specify a poster image for a video: –Type, where my-video.ext points to your video file and my-poster.jpg points to the image that you want to use as the poster image.

LEARN THE QUICK AND EASY WAY! VISUAL QUICKSTART GUIDE Preventing a Video from Preloading To instruct the browser to not preload a video: –Type my-video.ext points to your video file.

LEARN THE QUICK AND EASY WAY! VISUAL QUICKSTART GUIDE Other Preload Settings Preload="auto" starts downloading the video in anticipation of the user watching it. preload="metadata" asks the browser to retrieve basic information about the video, such as its dimensions, duration, and possibly a few frames of video.

LEARN THE QUICK AND EASY WAY! VISUAL QUICKSTART GUIDE Using Video with Multiple Sources and a Text Fallback To support all HTML5-capable browsers, supply video in at least two different formats. Source element allows you to define more than one source for a media element. –Browsers will load the first file format referenced in a source element that they support and ignore the rest.

LEARN THE QUICK AND EASY WAY! VISUAL QUICKSTART GUIDE To Specify Two Different Video Sources with a Fallback Obtain your video sources (two this time). Type to open video element. Type –my-video.mp4 points to your MP4 video source file. Type –my-video.webm points to your WebM video source file. Create a fallback link or message for older browsers. Type to close the video element.

LEARN THE QUICK AND EASY WAY! VISUAL QUICKSTART GUIDE Video Fallback MP4 fileWebM fallback

LEARN THE QUICK AND EASY WAY! VISUAL QUICKSTART GUIDE More About Multiple Media Sources Specifying multiple sources for the same media actually works because: –Browser checks to see if a src is defined in video element. –Since there isn't, it checks for source elements. –Goes through each looking for one that it can play. –Once it finds one, it plays it and ignores the rest. Any non-HTML5 browser will ignore video element and source element tags entirely when parsing the document. –It will display text entered just before closing the video element.

LEARN THE QUICK AND EASY WAY! VISUAL QUICKSTART GUIDE Providing Accessibility Keyboard accessibility of HTML5 video and audio is good in Firefox, Internet Explorer, and Opera. But for Chrome and Safari, the only way to have an accessible media player is by creating your own control set. WebVTT (Web Video Text Tracks) is HTML5's new file format that allows text subtitles, captions, descriptions, and chapters in video content.

LEARN THE QUICK AND EASY WAY! VISUAL QUICKSTART GUIDE Audio File Formats Main audio codecs: –Ogg Vorbis:.ogg file extension. Supported by Firefox 3.5+, Chrome 5+, and Opera –MP3: mp3 file extension. Supported by Safari 5+, Chrome 6+, IE9+, and iOS. –WAV:.wav file extension. Supported by Firefox 3.6+, Safari 5+, Chrome 8+, and Opera –AAC:.aac file extension. Supported by Safari 3+, IE 9+, iOS 3+, and Android 2+. –MP4:.mp4 file extension. Supported by Safari 3+, Chrome 5+, IE 9+, iOS 3+, and Android 2+. –Opus:.opus file extension. Only supported by Firefox.

LEARN THE QUICK AND EASY WAY! VISUAL QUICKSTART GUIDE Adding an Audio File with Controls to Your Webpage Audio element adds audio controls to your webpage. To add an audio file with controls to your webpage: –Obtain your audio file. –Type my-audio.ext is location, name, and extension of the audio file.

LEARN THE QUICK AND EASY WAY! VISUAL QUICKSTART GUIDE Audio Controls in Different Browsers FirefoxInternet Explorer 10

LEARN THE QUICK AND EASY WAY! VISUAL QUICKSTART GUIDE Exploring Audio Attributes Src: Specifies URL to audio file. Autoplay: Automatically starts audio. Controls: Adds browser's default control set to audio. Muted: Mutes audio. Loop: Plays audio in a loop. Preload: Hints how much audio to load. Has three different values: None, Metadata, and Auto. Mediagroup: Allows syncing media playback when combined with JavaScript.

LEARN THE QUICK AND EASY WAY! VISUAL QUICKSTART GUIDE When an Audio Format Isn’t Supported IE10 when it doesn’t support the audio file format you specify in src.

LEARN THE QUICK AND EASY WAY! VISUAL QUICKSTART GUIDE Autoplaying, Looping, and Preloading Audio Autoplay attribute makes an audio file start playing when the page loads. Loop attribute indicates that you want the audio to play in a loop. Request that the browser preload the audio file in different ways by using the preload attribute values.

LEARN THE QUICK AND EASY WAY! VISUAL QUICKSTART GUIDE To Start Audio Playing Automatically Type. –my-audio.ext points to your audio file. Omit controls and audio will play automatically but nothing will show in the browser.

LEARN THE QUICK AND EASY WAY! VISUAL QUICKSTART GUIDE To Loop and Preload Audio To play an audio file in a loop: –Type my-audio.ext points to your audio file. To ask the browser to preload only the audio’s metadata: –Type my-audio.ext points to your audio file.

LEARN THE QUICK AND EASY WAY! VISUAL QUICKSTART GUIDE Providing Multiple Audio Sources with Fallback Source element provides audio in more than one format. –Browsers that don’t support the audio element display the fallback. Type Attribute helps the browser decide if it can play the audio file.

LEARN THE QUICK AND EASY WAY! VISUAL QUICKSTART GUIDE To Specify Two Different Audio Sources with Fallback Obtain your audio files. Type to open the audio element. Type (Optionally, create fallback message or audio download link for browsers that don’t support HTML5 audio. Type to close the audio element.

LEARN THE QUICK AND EASY WAY! VISUAL QUICKSTART GUIDE Adding Video and Audio with a Flash Fallback MediaElement.js can be used to provide a Flash fallback player that can play the MP4 video file for older browsers. –First, you must obtain the MediaElement.js files and put them with your site’s other files. –Then you add a few of those files to your webpage. These steps are required for both video and audio. –From there, you may add a video or an audio file to your page. –When MediaElement.js is initialized by the script, it automatically determines whether the browser should use HTML5 native playback or the Flash player.

LEARN THE QUICK AND EASY WAY! VISUAL QUICKSTART GUIDE To Get the MediaElement.js Files in Your Site’s Directory Open a browser and go to Click the Download Latest button. Locate the ZIP file on your computer. Extract the files. Open the folder to reveal the subfolders. Copy the build folder and paste it into your website folder.

LEARN THE QUICK AND EASY WAY! VISUAL QUICKSTART GUIDE To Add MediaElement.js Files to Your Webpage Create an HTML page, or open an existing one. Add the highlighted code so your page will load the required style sheet and JavaScript files. Save the page in same directory with the build folder.

LEARN THE QUICK AND EASY WAY! VISUAL QUICKSTART GUIDE To Add a Flash Fallback to a Video Obtain your video files. Type to open the video element and include controls. Specify other attributes, like width, height, poster, and more, as desired. Type. –my-video.mp4 points to the MP4 video source file. Type. –my-video.webm points to the WebM video source file.

LEARN THE QUICK AND EASY WAY! VISUAL QUICKSTART GUIDE To Add a Flash Fallback to a Video Create a message and link as desired for browsers that support neither HTML5 video nor Flash. Type to close the video element. Initialize the video player by adding the code to your webpage. Put the script right before even if your page has more content than just the video.

LEARN THE QUICK AND EASY WAY! VISUAL QUICKSTART GUIDE To Provide a Flash Fallback for Your Audio Obtain your audio files. Type to open the audio element with the default control set. Specify other attributes. Type <source src="my-audio.ogg" type="audio/ogg. –my-audio.ogg points to your the Ogg Vorbis audio file. Type. –my-audio.mp3 points to your MP3 audio file.

LEARN THE QUICK AND EASY WAY! VISUAL QUICKSTART GUIDE To Provide a Flash Fallback for Your Audio Create a message and link as desired for browsers that support neither HTML5 audio nor Flash. Type to close the audio element. Initialize the audio player by adding the code to your webpage. Put the script right before even if your page has more content than just the audio.

LEARN THE QUICK AND EASY WAY! VISUAL QUICKSTART GUIDE Troubleshooting Flash Playback Flash has security settings that may prevent your media files from working while testing your webpage on your computer. One way around this is to upload your MP3 and MP4 files to your web server and then reference those files with absolute paths in the HTML.

LEARN THE QUICK AND EASY WAY! VISUAL QUICKSTART GUIDE Advanced Multimedia Canvas element allows you to draw and animate objects on webpages. –With JavaScript API, capture images from video and redraw them in canvas element as an image. Svg element allows SVG definitions to be embedded within the webpage itself. SVG allows shapes and graphics to be defined in XML, which the browser interprets and uses to draw the actual shapes. –Graphics produced by SVG are vector-based rather than raster-based, meaning that they scale well.