1 HTML5 Audio and Video Credits: Dr. Jay Urbain https://developer.mozilla.org/en-US/docs/HTML/Using_HTML5_audio_and_video.

Slides:



Advertisements
Similar presentations
HTML5 Overview Owen Williams owen at dynabooks daht com Owen Williams owen at dynabooks daht com.
Advertisements

 2004 Prentice Hall, Inc. All rights reserved. Chapter 28 – Multimedia: Audio, Video, Speech Synthesis and Recognition Outline 28.1 Introduction 28.2.
What is Multimedia ? Multi ( Multiple ) and Media ! So…. Information in multiple formats, including text, images, audio, video and animation :) It makes.
Chapter 15 HTML 5 Video and Audio Intro to HTML5 “Computers and Creativity” Richard D. Webster, COSC 109 Instructor Office: 7800 York Road, Room 422 |
Bring Life to Your Web Pages with JavaScript and HTML5 Part 2 Ole Ildsgaard Hougaard -
Chapter 11 Media and Interactivity Basics Key Concepts Copyright © 2013 Terry Ann Morris, Ed.D 1.
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.
Chapter 11 Media and Interactivity Basics Key Concepts
HTML5, OVERVIEW AND NEW FEATURES PowerPoint by Mason O’Mara.
HTML5 Media API.
HTML5 ETDs Edward A. Fox, Sung Hee Park, Nicholas Lynberg, Jesse Racer, Phil McElmurray Digital Library Research Laboratory Virginia Tech ETD 2010, June.
New Tags, New Attributes, New JavaScript APIs, Forms, Validation, Audio, Video, SVG, Canvas Doncho Minkov Telerik Corporation
IE 9Google .mp4.ogv.webm Width Height Src Poster Loop Autoplay Mute Preload controls.
LEARN THE QUICK AND EASY WAY! VISUAL QUICKSTART GUIDE HTML and CSS 8th Edition Chapter 17: Video, Audio, and Other MultiMedia.
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
Video, audio, embed, iframe, HTML Form
Tutorial 7 Working with Multimedia. XP Objectives Explore various multimedia applications on the Web Learn about sound file formats and properties Embed.
Chapter 15 HTML 5 Video and Audio Intro to HTML5 1.
Universal Media Player Terrill (UMP)
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.
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.
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.
IT Engineering I Instructor: Rezvan Shiravi
Multimedia and Web Technology Prepared by: Asst. Prof. Maryam Eskandari.
Programming Games Show your cannonball. HTML5 video. Miro. Classwork/Homework: Acquire video, convert to multiple formats, and produce simple (just html)
Tutorial 7 Working with Multimedia. XP Objectives Explore various multimedia applications on the Web Learn about sound file formats and properties Embed.
HTML Advanced: HTML 5. Introduction to HTML 5 These slides are based on source material found at the w3schools.com website.
The New Elements © Main Menu Structure Media Canvas Form Click on one of the categories below to view information about the new HTML5 elements in.
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 Chapter 11 Key Concepts 1 Copyright © Terry Felke-Morris.
Tutorial 7 Working with Multimedia
Tutorial 7 Designing a Multimedia Web Site
Tutorial 7 Working with Multimedia. New Perspectives on HTML, XHTML, and XML, Comprehensive, 3rd Edition 2 Objectives Explore various multimedia applications.
Tutorial 7 Working with Multimedia. New Perspectives on HTML, XHTML, and XML, Comprehensive, 3rd Edition 2 Objectives Explore various multimedia applications.
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.
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.
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.
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.
XP New Perspectives on Macromedia Dreamweaver MX 2004 Tutorial 5 1 Adding Shared Site Elements.
Chapter 8 Adding Multimedia Content to Web Pages HTML5 & CSS 7 th Edition.
CHAPTER 8 Multimedia 1. Using Multimedia ❖ Multimedia: the combination of text, sound, and video to express an idea or convey a message. ❖ Podcasts: a.
M ULTIMEDIA ON THE W EB. Multimedia Purpose of Multimedia Multimedia Issues HTML5 and elements CSS Transitions and Animations Animation to avoid.
HTML 5 (Part 1) – Start from SCRATCH. HTML 5 – Start from SCRATCH.
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
Chapter 2 Markup Language By : Madam Hazwani binti Rahmat
Chapter 9 HTML 5 Video and Audio
© 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>
Audio and Video on the Web
Tutorial 7 Working with Multimedia
HTML5 Level II Session II
Audio and Video Chapter 10.
Playing Video (Part 2).
Client-Side Internet and Web Programming
Working with Multimedia
How to add audio and video to your website
Show your animation project. HTML5 video. Miro.
Presentation transcript:

1 HTML5 Audio and Video Credits: Dr. Jay Urbain

History of Video Support in Browsers 2000: Had to install multiple plugins: RealPlayer, QuickTime, WMP : Flash becomes dominant 2009: HTML5 announces native video support 2013: HTML5 has ~80% user support 2

HTML5 Video Runs natively in the browser – No plug-in required Simpler coding – No need to have different coding for different formats Can be manipulated just like any other DOM element It’s a standard and becoming widely adopted – Flash is dead (and iOS never supported it) – Smartphones support it 3

<video width="320" height="240" controls poster=“mallard.jpg” autoplay> Your browser does not support the video tag. 4 If height and width are set, the space required for the video is reserved when the page is loaded. Without these attributes, the browser does not know the size of the video, and is likely to change during loading. The size can also be specified in %. allows multiple elements. elements can link to different video files. The browser will use the first recognized format Insert text content between the tags for browsers that do not support the element. The controls attribute adds video controls, like play, pause, and volume. The poster attribute indicates the first frame to appear. Autoplay – guess!

Demo ideo_all 5

Video Containers A video file is a “container”, which contains – Video stream – Audio stream – Metadata (“table of contents”) The streams are combined during video playback Metadata includes – Title, subtitle, cover art, captioning info,… 6

(Current) Video Container File Formats MP4 ( video_file.mp4) – H.264 (video codec format) + AAC (audio codec format) Ogg (video_file.org,.ogv, or.ogg) – Theora (video codec format) + Vorbis (audio codec format) WebM ( video_file.webm ) – VP8 (video codec format) + Vorbis (audio codec format) 7

What is a Codec? Codecs (Coders/Decoders) are algorithms used to encode and decode a particular video/audio stream so that they can played back Why codecs ? – Raw media files too big to transmit over the internet Example video codecs – H.264, VP8, Ogg Theora Example audio codecs – AAC, MPEC-3, Ogg Vorbis 8

Video Formats and Browser Support There is not a single Codec that is currently supported by all browser! 9 See caniuse.com

MIME Types for Video Formats 10

Encoding Tools Firefogg – Video and audio encoding for Firefox – Handbrake.fr – An open source multiplatform video transcoder – Zencoder – API-based online video encoding service – Microvideo Converter – Video converter – 11

HTML5 - DOM Methods and Properties HTML5 has DOM methods, properties, and events for the and elements. Allows you to manipulate and elements using JavaScript. Demo: 12

Play/Pause Your browser does not support HTML5 video. var myVideo=document.getElementById("video1"); function playPause() { if (myVideo.paused) myVideo.play(); else myVideo.pause(); } 13 ml5_video_js_prop Manipulating via JS events

HTML5 Video Tags 14

HTML5 subelement Provides a standardized way to add subtitles, captions, screen reader descriptions and chapters to video and audio. Tracks can be used for timed metadata. The source data for each track element is a text file made up of a list of timed cues. Cues can include data in formats such as HTML, JSON, or CSV. Track element is currently available in Internet Explorer 10 and Google Chrome. Firefox support is not yet implemented. e/video/developerStories-en.webm <track kind="captions" src="sintel-en.vtt" srclang="en" label="English captions" default /> --> 15

Track kind and src attributes Attribute for kind can be subtitles, captions, descriptions, chapters or metadata. The src attribute points to a text file that holds data for timed track cues. Chrome supports WebVTT, which looks like this: WEBVTT introduction 00: > 00: Is this LOTR:The Two Towers? Lead character 00: > 00: That's not Frodo! 16 hours:minutes:seconds:milliseconds Cue – text can include HTML

Five types of tracks Subtitles - Translations of the dialogue in the video Captions - Transcription of the dialogue, sound effects, musical cues, and other audio information Chapters - Used to create navigation within the video, Typically they're in the form of a list of chapters that the viewer can click on to go to a specific chapter. Descriptions (not supported yet) - Text descriptions of what's happening in the video Metadata (not supported yet) - Tracks that have data meant for javascript to parse and do something with. These aren't shown to the user 17

Cues support HTML: 18

Cues can also use JSON: 19

Search and deep navigation Tracks can also add value to audio and video by making search easier, more powerful and more precise. Cues include text that can be indexed, and a start time that signifies the temporal 'location' of content within media. 20

HTML5 Audio Your browser does not support the audio element. 21

Audio Formats and Browser Support 22

MIME Types for Audio Formats 23

HTML5 Audio Tags 24

attributes The control attribute adds audio controls, like play, pause, and volume. Insert text content between the tags for browsers that do not support the element. allows multiple elements. elements can link to different audio files. The browser will use the first recognized format. tag supports the full range of standard attributes in HTML5. 25

attributes New attributes for the tag: – controls - controls for the audio file will be included on the page – loop - the audio will loop and play again once it has finished – preload - this one has three parameters: auto, which plays once it has loaded, metadata, which only displays the data associated with the audio file, and none, which means it will not preload – src - the URL of the audio file you wish to play Example: 26

Manipulating video using canvas By combining the capabilities of the element with the element, you can manipulate video data in real time to incorporate a variety of visual effects to the video being displayed. 27

Canvas Gradients ename=tryhtml5_video_js_prop ename=tryhtml5_video_js_prop 28

Canvas Gradients Shapes on the canvas are not limited to solid colors. Gradients can be used to fill rectangles, circles, lines, text, etc. There are two different types of gradients: – createLinearGradient(x,y,x1,y1) - Creates a linear gradient – createRadialGradient(x,y,r,x1,y1,r1) - Creates a radial/circular gradient Add two or more color stops to Gradient object: – addColorStop() method specifies the color stops, and its position along the gradient. Gradient positions can be anywhere between 0 to 1. To use the gradient, set the fillStyle or strokeStyle property to the gradient, and then draw the shape, like a rectangle, text, or a line. 29

Canvas Gradients Using createLinearGradient(): var c=document.getElementById("myCanvas"); var ctx=c.getContext("2d"); // Create gradient var grd=ctx.createLinearGradient(0,0,200,0); grd.addColorStop(0,"red"); grd.addColorStop(1,"white"); // Fill with gradient ctx.fillStyle=grd; ctx.fillRect(10,10,150,80); 30

Canvas Gradients & Canvas Video Interactive Canvas Gradients: Video Canvas: 31