HTML5 Media API.

Slides:



Advertisements
Similar presentations
Building Fast 3rd-Party Webapps O'Reilly Velocity Web Performance and Operations Conference 24 June Lessons.
Advertisements

PART IV - EMBED VIDEO, AUDIO, AND DOCUMENTS. Find a video on Youtube.com: Search for a video, then look for the Embed code. Copy this code into the HTML/JavaScript.
HTML5 Overview Owen Williams owen at dynabooks daht com Owen Williams owen at dynabooks daht com.
HTML5 Overview HOANGPT2. 1. General 2. New Elements List 3.
FormatIEFirefoxOperaChromeSafari OggNo No MPEG 49.0+No WebMNo No FormatIE 9Firefox 3.5Opera 10.5 Chrome 3.0 Safari.
JavaScript and AJAX Jonathan Foss University of Warwick
What is Multimedia ? Multi ( Multiple ) and Media ! So…. Information in multiple formats, including text, images, audio, video and animation :) It makes.
Bring Life to Your Web Pages with JavaScript and HTML5 Part 2 Ole Ildsgaard Hougaard -
1 HTML5 Audio and Video Credits: Dr. Jay Urbain
HTML5, OVERVIEW AND NEW FEATURES PowerPoint by Mason O’Mara.
New Tags, New Attributes, New JavaScript APIs, Forms, Validation, Audio, Video, SVG, Canvas Doncho Minkov Telerik Corporation
A really fairly simple guide to: mobile browser-based application development (part 1) Chris Greenhalgh G54UBI / Chris Greenhalgh
LEARN THE QUICK AND EASY WAY! VISUAL QUICKSTART GUIDE HTML and CSS 8th Edition Chapter 17: Video, Audio, and Other MultiMedia.
Neal Stublen Pre-HTML5 Solutions  Audio and video were embedded in pages using plug-ins Apple Quicktime Microsoft Silverlight Adobe.
HTML5 Application Development Fundamentals
HTML 5. What is HTML5? HTML5 will be the new standard for HTML, XHTML, and the HTML DOM. The previous version of HTML came in The web has changed.
Video, audio, embed, iframe, HTML Form
INF Web Design Using Multimedia on the Web Video - Part 1.
HTML 5 Tutorial Chapter 1 Introduction. What is HTML5? HTML5 will be the new standard for HTML, XHTML, and the HTML DOM. The previous version of HTML.
XML To this point, we’ve pretty much ignored or brushed over the use of xml What is xml? – xml is eXtensible Markup Language – it is a metalanguage for.
HTML Advanced: HTML 5. Welcome This slideshow presentation is designed to introduce you to HTML 5. It is the third of three HTML workshops available at.
Lecture 18. HTML5 and JavaScript Instructor: Jie Yang Department of Computer Science University of Massachusetts Lowell Exploring the Internet,
© De Montfort University, Document Object Model Howell Istance School of Computing De Montfort University.
Universal Media Player Terrill (UMP)
It’s World Wide! I NTRODUCTION TO T HE WEB 1 Photo courtesy:
Definition from Wikipedia.  The Prototype JavaScript Framework  implemented as a single file of JavaScript code  named prototype.js (
Overview of HTML. Three Different Approaches  Text editor like Notepad  HTML editor such as: –KompoZer –DreamWeaver –Microsoft Expression Web –iWeb.
Session: 11. © Aptech Ltd. 2HTML5 Audio and Video / Session 11  Describe the need for multimedia in HTML5  List the supported media types in HTML5 
INTRODUCTION TO CLIENT-SIDE WEB PROGRAMMING ACM 511 ACM 262 Course Notes.
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.
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.
HTML 5 New Standardization of HTML. I NTRODUCTION HTML5 is The New HTML Standard, New Elements New Attributes Full CSS3 Support Video and Audio 2D/3D.
Multimedia and Web Technology Prepared by: Asst. Prof. Maryam Eskandari.
AJAX and Java ISYS 350. AJAX Asynchronous JavaScript and XML: – Related technologies: JavaScript, Document Object Model, XML, server-side script such.
JQUERY | INTRODUCTION. jQuery  Open source JavaScript library  Simplifies the interactions between  HTML document, or the Document Object Model (DOM),
HTML Advanced: HTML 5. Introduction to HTML 5 These slides are based on source material found at the w3schools.com website.
MIS 425 Lecture 3 – HTML 5 and CSS Instructor: Martin Neuhard
(HTML 5) Audio. FormatIE 9Firefox 3.5Opera 10.5Chrome 3.0Safari 3.0 OggNoYes No MP3YesNo Yes WavNoYes NoYes Audio Formats.
Your Metro style app, video and audio, Part 1
Web Design (1) Terminology. Coding ‘languages’ (1) HTML - Hypertext Markup Language - describes the content of a web page CSS - Cascading Style Sheets.
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.
Internet & World Wide Web How to Program, 5/e. © by Pearson Education, Inc. All Rights Reserved.
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.
Web Technologies Lecture 7 Synchronous vs. asynchronous.
AJAX Asynchronous JavaScript and XML 1. AJAX Outline What is AJAX? Benefits Real world examples How it works 2.
Introduction to JavaScript MIS 3502, Spring 2016 Jeremy Shafer Department of MIS Fox School of Business Temple University 2/2/2016.
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.
What is HTML5? HTML5 will be the new standard for HTML. The previous version of HTML, HTML 4.01, came in The web has changed a lot since then. HTML5.
Internet & World Wide Web How to Program, 5/e.  JavaScript events  allow scripts to respond to user interactions and modify the page accordingly  Events.
CHAPTER 10 AUDIO AND VIDEO. MEDIA PLAYER API HTML5 contains an API (Application Programming Interface) for controlling audio and video players embedded.
Introduction to JavaScript MIS 3502, Fall 2016 Jeremy Shafer Department of MIS Fox School of Business Temple University 9/29/2016.
Chapter 4: Feature Detection & Drag and Drop
Egyptian Language School General Questions Prep.2
Chapter 9 HTML 5 Video and Audio
Web Concepts Lesson 2 ITBS2203 E-Commerce for IT.
Chap 3. Audio/Video api.
Embedding Media into Web Pages
Chapter 4: HTML5 Media - <video> & <audio>
HTML 5 Tutorial Chapter 1 Introduction.
Introduction to JavaScript
Audio and Video Chapter 10.
Essentials of Web Pages
Playing Audio (Part 1).
Client-Side Internet and Web Programming
A second look at JavaScript
Overview of HTML.
Introduction to JavaScript
Giuseppe Attardi Università di Pisa
Murach's JavaScript and jQuery (3rd Ed.)
Presentation transcript:

HTML5 Media API

Who am I Ran Bar-Zik \ @barzik PHP\Drupal Developer at HP Software R&D Working at HP Live Network project. My professional site: internet-israel.com

HTML 5 Media tags: Audio Audio tag: <audio controls="controls"> <source src="horse.ogg" type="audio/ogg"> <source src="horse.mp3" type="audio/mp3"> Your browser does not support the audio tag. </audio>

HTML 5 Media tags: Video Video tag: <video controls="controls"> <source src="movie.mp4" type="video/mp4"> <source src="movie.ogg" type="video/ogg"> Your browser does not support the video tag. </video>

Supporting Browsers Chrome Firefox Opera Safari Internet Explorer 9+

Media Tags Attribute src = URL - The source of the media Autoplay = Boolean Loop = Boolean Controls = Boolean Preload = auto(yes), metadata(only meta data) or none Video only: Poster = URL - The source of the poster Muted = Boolean

Media DOM API All Media tags is valid HTML elements. All HTML attributes can be changed via JavaScript as any other elements. var myVideo=document.getElementById("video1"); myVideo.width=560; This code will change the width of the video.

Basic API Methods\Properties: Play Methods for play \ pause: var myVideo=document.getElementById("video1"); myVideo.play(); myVideo.pause(); Property for play \ pause: myVideo.paused; //return TRUE\FALSE

Basic API Methods\Properties: Seek Methods for play \ pause: var myVideo=document.getElementById("video1"); myVideo.duration = X; //Seek Property for seeking: myVideo.currentTime //return seconds myVideo.duration //return duration in seconds myVideo.seeking //return TRUE\FALSE

Basic API Properties: Volume Properties for play \ pause: var myVideo=document.getElementById("video1"); myVideo.volume //returns volume (0-1) myVideo.volume = X //define the video volume myVideo.muted // returns FALSE/TRUE

API Properties: Event handling document.getElementById(“video1”).addEventListener('ended',myHandler,false); function myHandler(e) { //your function }

API Methods\Properties: Ready State Property for finding the ready state: myVideo.readyState; //return ready state code 0 - nothing 1 – meta data available (duration) 2 – have current data (enough for current frame) 3 – have future data (enough for this frame and the next one). 4 – have enough data (can finish the show)

Video\Audio subtitles Why subtitles matters? Hebrew Accessibility SEO

Using track tag Simple way for implementing Subtitles. Right now is being implemented by Safari\Chrome only. In the future – it will be the best practice – SEO wise.

Using track tag Simple way for implementing Subtitles. Right now is being implemented by Safari\Chrome only. In the future – it will be the best practice – SEO wise.

Track example <video src="foo.ogv"> <track kind="subtitles" label="English subtitles" src="subtitles_en.vtt" srclang="en" default> </track> <track kind="subtitles" label="Deutsche Untertitel" src="subtitles_de.vtt" srclang="de"> </video>

WebVTT: Web Video Text Track example 00:11.000 --> 00:13.000 We are in New York City 00:13.000 --> 00:16.000 actually at the Lucern Hotel, just down the street 00:16.000 --> 00:18.000 from the American Museum of Natural History More information on WebVTT is in W3C: http://dev.w3.org/html5/webvtt/

Test with track support with Modernizr Described in Modernizr documentation: //first run that one Modernizr.addTest('track', function(){ var video = document.createElement('video'); return typeof video.addTextTrack === 'function' }); // return TRUE or FALSE Modernizr.track

JavaScript track fallback You can Support track elements with captionatorjs (Having problems with IE9) http://captionatorjs.com/

JavaScript track fallback You can implement your own subtitle JavaScript based system. With or without jQuery. Example: http://www.internet-israel.com/?p=3489

HTML 5 Video future feature: mediagroup\ Media Controller Using mediagroup attribute will help sync between movies. Helping to implement commercials embedding, audio commentary etc. <video id="video1" controls="controls" mediagroup="test"> <source src="mov_bbb.mp4" type="video/mp4"> <source src="mov_bbb.ogg" type="video/ogg"> Your browser does not support HTML5 video. </video> <video id="video2" controls="controls" mediagroup="test">

More Current Implementation There are a lot of new features that are not implemented yet. For current information. Check: http://www.longtailvideo.com/html5/