Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards...

214
© 2014 Apple Inc. All rights reserved. Redistribution or public display not permitted without written permission from Apple. #WWDC14 Advanced Media for the Web Session 504 Jer Noble WebKit Engineer Media Media for the modern web

Transcript of Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards...

Page 1: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.

© 2014 Apple Inc. All rights reserved. Redistribution or public display not permitted without written permission from Apple.

#WWDC14

Advanced Media for the Web

Session 504 Jer Noble WebKit Engineer

Media

Media for the modern web

Page 2: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.

<video>

Page 3: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.

<video>

Page 4: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.

<img>

<audio>

<caption>

<table>

<ul> <figure>

<svg> <form>

<button> <button>

<div> <span>

<video>

Page 5: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.

<img>

<audio>

<caption>

<table>

<ul> <figure>

<svg> <form>

<button> <button>

<div> <span>

<video>

Page 6: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.

<img>

<audio>

<caption>

<table>

<ul> <figure>

<svg> <form>

<button> <button>

<div> <span>

<video>

Page 7: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.

<img>

<audio>

<caption>

<table>

<ul> <figure>

<svg> <form>

<button> <button>

<div> <span>

<video>

Page 8: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.

<video>

Page 9: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.
Page 10: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.

PerformanceOverview Tech Specs

Page 11: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.

1999

Page 12: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.

<OBJECT CLASSID="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" CODEBASE="http://www.apple.com/qtactivex/qtplugin.cab" HEIGHT=480 WIDTH=640> <PARAM NAME="src" VALUE="MyMovie.mov" > <EMBED SRC=“MyMovie.mov” HEIGHT=640 WIDTH=480 TYPE="video/quicktime" PLUGINSPAGE="http://www.apple.com/quicktime/download/" /> </OBJECT>

Page 13: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.

2006

Page 14: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.

<OBJECT CLASSID="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" CODEBASE="http://www.apple.com/qtactivex/qtplugin.cab" HEIGHT=480 WIDTH=640> <PARAM NAME="src" VALUE="MyMovie.mov" > <EMBED SRC=“MyMovie.mov” HEIGHT=640 WIDTH=480 TYPE="video/quicktime" PLUGINSPAGE="http://www.apple.com/quicktime/download/" /> </OBJECT>

Page 15: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.

2007

Page 16: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.

<video>

Page 17: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.

2009

Page 18: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.
Page 19: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.
Page 20: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.

Past Sessions

Available at http://developer.apple.com/

Page 21: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.

Past Sessions

Available at http://developer.apple.com/

Delivering audio and video using web standards

Page 22: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.

Past Sessions

Available at http://developer.apple.com/

Delivering audio and video using web standards

Advanced HTML5 media controllers in Safari

Page 23: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.

Past Sessions

Available at http://developer.apple.com/

Delivering audio and video using web standards

Advanced HTML5 media controllers in Safari

Advanced effects with HTML5 media technologies

Page 24: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.

What You Will Learn

Narrowing platform differences

Stream adaptive media

Improve power efficiency

Coordinate events

Page 25: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.

What You Will Learn

Narrowing platform differences

Stream adaptive media

Improve power efficiency

Coordinate events

Page 26: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.

What You Will Learn

Narrowing platform differences

Stream adaptive media

Improve power efficiency

Coordinate events

Page 27: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.

What You Will Learn

Narrowing platform differences

Stream adaptive media

Improve power efficiency

Coordinate events

Page 28: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.

A Brief Rant About Plug-ins

Page 29: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.

A Brief Rant About Plug-insor

How I Learned to Stop Worryingand Love the DOM

Page 30: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.

What You Will Learn

Narrowing platform differences

Stream adaptive media

Improve power efficiency

Coordinate events

Page 31: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.

Narrowing Platform Differences

Page 32: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.

Narrowing Platform Differences

Control media loading

Page 33: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.

Narrowing Platform Differences

Control media loading

Participate in layering

Page 34: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.

Control Media LoadingPreload

none no media data

metadata only media metadata

auto enough media data to start playback

Page 35: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.

Control Media LoadingPreload

<video preload="none|metadata|auto">

none no media data

metadata only media metadata

auto enough media data to start playback

Page 36: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.

Control Media LoadingPreload

<video preload="none|metadata|auto">

none no media data

metadata only media metadata

auto enough media data to start playback

Page 37: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.

Control Media LoadingPreload

<video preload="none|metadata|auto">

none no media data

metadata only media metadata

auto enough media data to start playback

Page 38: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.

Control Media LoadingPreload

<video preload="none|metadata|auto">

none no media data

metadata only media metadata

auto enough media data to start playback

Page 39: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.

Control Media LoadingPreload values

Accepted Default

OS X none, metadata, auto auto

iOS 7 none none

iOS 8 none, metadata metadata

Page 40: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.

Control Media LoadingPreload values

Accepted Default

OS X none, metadata, auto auto

iOS 7 none none

iOS 8 none, metadata metadata

Page 41: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.

Control Media LoadingPreload values

Accepted Default

OS X none, metadata, auto auto

iOS 7 none none

iOS 8 none, metadata metadata

Page 42: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.

Control Media LoadingPreload values

Accepted Default

OS X none, metadata, auto auto

iOS 7 none none

iOS 8 none, metadata metadata

Page 43: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.

Control Media LoadingPreload values

Accepted Default

OS X none, metadata, auto auto

iOS 7 none none

iOS 8 none, metadata metadata

Page 44: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.

Control Media LoadingRationale

Page 45: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.

Control Media LoadingRationale

No change in behavior for most sites

Page 46: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.

Control Media LoadingRationale

No change in behavior for most sites

Allows pages to request no loading of metadata

Page 47: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.

Control Media LoadingRationale

No change in behavior for most sites

Allows pages to request no loading of metadata

Keeps user control over media loading

Page 48: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.

Control Media LoadingRationale

No change in behavior for most sites

Allows pages to request no loading of metadata

Keeps user control over media loading

Makes iOS more like OS X

Page 49: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.

Control Media LoadingBreaking changes

<video> will begin to emit "loadedmetadata" events

Page 50: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.

Control Media LoadingBreaking changes

onloadedmetadata = "this.controls = false">

<video controls

Page 51: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.

Control Media LoadingBreaking changes

iOS 7 Initial

iOS 7

iOS 8

nothing loadedmetadata play

onloadedmetadata = "this.controls = false">

<video controls

Page 52: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.

Control Media LoadingBreaking changes

iOS 7 Loads

iOS 7

iOS 8

nothing loadedmetadata play

onloadedmetadata = "this.controls = false">

<video controls

Page 53: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.

Control Media LoadingBreaking changes

iOS 7 User Clicks Play

iOS 7

iOS 8

nothing loadedmetadata play

onloadedmetadata = "this.controls = false">

<video controls

Page 54: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.

Control Media LoadingBreaking changes

iOS 8 loads

iOS 7

iOS 8

nothing loadedmetadata play

onloadedmetadata = "this.controls = false">

<video controls

Page 55: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.

Control Media LoadingBreaking changes

iOS 8 loads

iOS 7

iOS 8

nothing loadedmetadata play

= "this.controls = false">

<video controls

onplay

Page 56: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.

Control Media LoadingBreaking changes

iOS 8 click play

iOS 7

iOS 8

nothing loadedmetadata play

= "this.controls = false">

<video controls

onplay

Page 57: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.

Participate in Layering

Page 58: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.

Participate in Layering

In iOS 7, <video> was layered topmost

Page 59: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.

Participate in Layering

In iOS 7, <video> was layered topmost

In iOS 8, <video> respects CSS layering

Page 60: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.

Participate in Layering

In iOS 7, <video> was layered topmost

In iOS 8, <video> respects CSS layering

Caveat—Websites depending on iOS 7 behavior will break

Page 61: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.

What You Will Learn

Narrowing platform differences

Stream adaptive media

Improve power efficiency

Coordinate events

Page 62: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.

What You Will Learn

Narrowing platform differences

Stream adaptive media

Improve power efficiency

Coordinate events

Page 63: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.

StreamingResponsive web design

Page 64: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.

StreamingResponsive web design

The goal of responsive design is an optimal web experience across all devices

Page 65: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.

StreamingResponsive web design

The goal of responsive design is an optimal web experience across all devices

The page “responds” to characteristics of those devices

Page 66: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.

StreamingResponsive web design

The goal of responsive design is an optimal web experience across all devices

The page “responds” to characteristics of those devices

Viewport size is the most commonly used characteristic

Page 67: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.

StreamingResponsive web design

The goal of responsive design is an optimal web experience across all devices

The page “responds” to characteristics of those devices

Viewport size is the most commonly used characteristic

Adaptive media uses viewport size and more

Page 68: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.

StreamingDelivering adaptive media

Page 69: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.

StreamingDelivering adaptive media

Viewport dimensions

Page 70: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.

StreamingDelivering adaptive media

Viewport dimensions

Maximum video resolution

Page 71: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.

StreamingDelivering adaptive media

Viewport dimensions

Maximum video resolution

Codec support

Page 72: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.

StreamingDelivering adaptive media

Viewport dimensions

Maximum video resolution

Codec support

Bandwidth availability

Page 73: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.
Page 74: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.
Page 75: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.
Page 76: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.
Page 77: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.
Page 78: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.
Page 79: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.

HTTP Live Streaming

Page 80: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.

HTTP Live StreamingHLS

Page 81: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.

HTTP Live StreamingHLS

Manifest-based

Page 82: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.

HTTP Live StreamingHLS

Manifest-based

Master playlist describes each stream

Page 83: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.

HTTP Live StreamingHLS

Manifest-based

Master playlist describes each stream

Browser chooses the appropriate stream

Page 84: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.

HTTP Live StreamingHLS

Manifest-based

Master playlist describes each stream

Browser chooses the appropriate stream

Seamless stream switching

Page 85: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.

HTTP Live StreamingHLS

Manifest-based

Master playlist describes each stream

Browser chooses the appropriate stream

Seamless stream switching

Native quality

Page 86: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.

DemoHTTP Live Streaming

Brent Fulgham WebKit Engineer

Page 87: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.

HTTP Live Streaming

Tech Note 2224—Best Practices for Creating and Deploying HLS Media https://developer.apple.com/library/ios/technotes/tn2224/

HTTP Live Streaming Tools https://developer.apple.com/downloads/

HTTP Live Streaming Developer Page https://developer.apple.com/streaming/

Page 88: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.

Media Source Extensions

Page 89: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.

Media Source ExtensionsMSE

Page 90: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.

Media Source ExtensionsMSE

An extension to the HTML5 specification

Page 91: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.

Media Source ExtensionsMSE

An extension to the HTML5 specification

<video src=“myMovie.mp4”>

Page 92: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.

An extension to the HTML5 specification

<video src=“mediasource://....”>

Media Source ExtensionsMSE

Page 93: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.

An extension to the HTML5 specification

<video src=“mediasource://....”>

Complete control over data loading

Media Source ExtensionsMSE

Page 94: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.
Page 95: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.

“With great power comes great responsibility.”

Voltaire

Page 96: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.

Uncle Ben

“With great power comes great responsibility.”

Page 97: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.

MSERequirements

Page 98: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.

MSERequirements

Fetch media explicitly

Page 99: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.

MSERequirements

Fetch media explicitly

Prefetch media manually

Page 100: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.

MSERequirements

Fetch media explicitly

Prefetch media manually

Monitor network conditions manually

Page 101: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.

MSERequirements

Fetch media explicitly

Prefetch media manually

Monitor network conditions manually

Monitor playback metrics manually

Page 102: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.

MSERequirements

Fetch media explicitly

Prefetch media manually

Monitor network conditions manually

Monitor playback metrics manually

Switch streams manually

Page 103: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.

HLS vs. MSESystem information

HLS MSE

CPU Activity

Network Type

Battery

Available Memory

Page 104: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.

HLS vs. MSESystem information

HLS MSE

CPU Activity

Network Type

Battery

Available Memory

Page 105: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.

HLS vs. MSESystem information

HLS MSE

CPU Activity

Network Type

Battery

Available Memory

Page 106: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.

HLS vs. MSESystem information

HLS MSE

CPU Activity

Network Type

Battery

Available Memory

Page 107: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.

HLS vs. MSESystem information

HLS MSE

CPU Activity

Network Type

Battery

Available Memory

Page 108: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.

HLS vs. MSEComplexity

Page 109: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.

HLS vs. MSEComplexity

MSE requires a large JavaScript implementation

Page 110: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.

HLS vs. MSEComplexity

MSE requires a large JavaScript implementation

HLS requires a single line of HTML

Page 111: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.

HLS vs. MSEComplexity

MSE requires a large JavaScript implementation

HLS requires a single line of HTML

HLS is supported on iOS Safari

Page 112: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.

Desktop Browser Support

HLS MSE

OS X Safari

iOS Safari

Android Browser

Internet Explorer

Google Chrome Future

Firefox Future Future

Page 113: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.

Desktop Browser Support

HLS MSE

OS X Safari

iOS Safari

Android Browser

Internet Explorer

Google Chrome Future

Firefox Future Future

Page 114: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.

Desktop Browser Support

HLS MSE

OS X Safari

iOS Safari

Android Browser

Internet Explorer

Google Chrome Future

Firefox Future Future

Page 115: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.

Desktop Browser Support

HLS MSE

OS X Safari

iOS Safari

Android Browser

Internet Explorer

Google Chrome Future

Firefox Future Future

Page 116: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.

Desktop Browser Support

HLS MSE

OS X Safari

iOS Safari

Android Browser

Internet Explorer

Google Chrome Future

Firefox Future Future

Page 117: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.

Desktop Browser Support

HLS MSE

OS X Safari

iOS Safari

Android Browser

Internet Explorer

Google Chrome Future

Firefox Future Future

Page 118: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.

Desktop Browser Support

HLS MSE

OS X Safari

iOS Safari

Android Browser

Internet Explorer

Google Chrome Future

Firefox Future Future

Page 119: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.

Streaming

Page 120: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.

Streaming

No settled streaming technology

Page 121: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.

Streaming

No settled streaming technology

For Safari users, use HLS

Page 122: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.

What You Will Learn

Narrowing platform differences

Stream adaptive media

Improve power efficiency

Coordinate events

Page 123: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.

What You Will Learn

Narrowing platform differences

Stream adaptive media

Improve power efficiency

Coordinate events

Page 124: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.

Increasing Power Efficiency

Page 125: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.

Increasing Power Efficiency

Page 126: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.

Increasing Power Efficiency

Page 127: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.

Increasing Power Efficiency

Page 128: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.

Increasing Power Efficiency

Apple devices have amazing battery life

Page 129: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.

Increasing Power Efficiency

Apple devices have amazing battery life

Last mile is up to you

Page 130: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.

Increasing Power Efficiency

Apple devices have amazing battery life

Last mile is up to you

Power use is easy to get wrong

Page 131: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.

PowerBest practices

Page 132: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.

PowerBest practices

Fullscreen mode

Page 133: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.

PowerBest practices

Fullscreen mode

Sleep cycles

Page 134: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.

PowerFullscreen

Page 135: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.

PowerFullscreen

Let apps nap

Page 136: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.

PowerFullscreen

Let apps nap

Low-power compositing

Page 137: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.

PowerPixel formats

Page 138: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.

PowerPixel formats

R

G

B

Page 139: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.

PowerPixel formats

R

G

B

8

8

8

Page 140: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.

PowerPixel formats

Page 141: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.

PowerPixel formats

Y

Page 142: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.

PowerPixel formats

Y

UV

Page 143: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.

PowerPixel formats

Y

UV

4:

2:2

Page 144: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.

YUV 422

PowerPixel formats

Page 145: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.

YUV 422

PowerPixel formats

Page 146: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.

YUV 422

PowerPixel formats

Page 147: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.

YUV 422

PowerPixel formats

Page 148: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.

PowerCompositing

Page 149: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.

PowerCompositing

Page 150: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.

PowerCompositing

Page 151: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.

PowerCompositing

Page 152: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.

PowerCompositing

Page 153: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.

PowerLow-power compositing

Page 154: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.

PowerLow-power compositing

Page 155: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.

PowerLow-power compositing

Page 156: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.

Low-Power CompositingPrerequisites

Page 157: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.

Low-Power CompositingPrerequisites

Use the Fullscreen API

Page 158: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.

Low-Power CompositingPrerequisites

Use the Fullscreen API

Use a black background

Page 159: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.

Low-Power CompositingPrerequisites

Use the Fullscreen API

Use a black background

Use display:none on your controls

Page 160: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.

Low-Power CompositingPrerequisites

Use the Fullscreen API

Use a black background

Use display:none on your controls

Hide everything else

Page 161: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.

Low-Power CompositingFullscreen API

function fullscreenToggle() { if (this === document.webkitCurrentFullscreenElement) document.webkitCancelFullscreen(); else this.webkitRequestFullscreen(); } !

Page 162: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.

Low-Power CompositingHide everything else

Page 163: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.

Low-Power CompositingHide everything else

:-webkit-full-screen-ancestor >

Page 164: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.

Low-Power CompositingHide everything else

:-webkit-full-screen-ancestor > :not(:-webkit-full-screen-ancestor):not(:-webkit-full-screen)

Page 165: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.

Low-Power CompositingHide everything else

:-webkit-full-screen-ancestor > :not(:-webkit-full-screen-ancestor):not(:-webkit-full-screen) { display: none; }

Page 166: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.

Low-Power CompositingHide everything else

:-webkit-full-screen-ancestor > :not(:-webkit-full-screen-ancestor):not(:-webkit-full-screen) { display: none; }

:-webkit-full-screen-ancestor > :not(:-webkit-full-screen-ancestor):not(:-webkit-full-screen) { display: none; } !

Page 167: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.

PowerBest practices

Fullscreen mode

Sleep cycles

Page 168: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.

PowerSleep

Page 169: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.

PowerSleep

<video> playback will keep the system awake

Page 170: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.

PowerSleep

<video> playback will keep the system awake

Only with specific criteria

Page 171: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.

PowerStay awake

Page 172: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.

PowerStay awake

Has video and audio track

Page 173: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.

PowerStay awake

Has video and audio track

Is playing

Page 174: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.

PowerStay awake

Has video and audio track

Is playing

Not looping

Page 175: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.

PowerGo to sleep

Has video and audio track

Is playing

Not looping

Page 176: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.

PowerGo to sleep

Has video and audio track

Is playing

Not looping

Page 177: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.

PowerGo to sleep

Has video and audio track

Is playing

Not looping

Page 178: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.

PowerGo to sleep

Has video and audio track

Is playing

Not looping

Page 179: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.

PowerGo to sleep

Has video and audio track

Is playing

Not looping

Page 180: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.

PowerStay awake

Has video and audio track

Is playing

Not looping

Page 181: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.

PowerStay awake

Has video and audio track

Is playing

Not looping

Is visible

Page 182: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.

What You Will Learn

Narrowing platform differences

Stream adaptive media

Improve power efficiency

Coordinate events

Page 183: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.

What You Will Learn

Narrowing platform differences

Stream adaptive media

Improve power efficiency

Coordinate events

Page 184: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.

Timed Metadata

Page 185: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.

Timed Metadata

Data delivered along with media

Page 186: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.

Timed Metadata

Data delivered along with media

In the media’s timeline

Page 187: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.

Timed MetadataExamples of Timed Metadata

Page 188: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.

Timed MetadataExamples of Timed Metadata

Caption tracks

Page 189: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.

Timed MetadataExamples of Timed Metadata

Caption tracks

Subtitle tracks

Page 190: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.

Timed MetadataExamples of Timed Metadata

Caption tracks

Subtitle tracks

Chapter tracks

Page 191: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.

Timed MetadataExamples of Timed Metadata

Caption tracks

Subtitle tracks

Chapter tracks

Metadata tracks

Page 192: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.

Timed MetadataAPI

Page 193: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.

Timed MetadataAPI

Available through AVFoundation framework

Page 194: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.

Timed MetadataAPI

Available through AVFoundation framework

Web apps can use TextTrack APIs

Page 195: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.

Timed MetadataTextTrackCue

interface TextTrackCue {

Page 196: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.

Timed MetadataTextTrackCue

interface TextTrackCue { attribute double startTime;

Page 197: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.

Timed MetadataTextTrackCue

interface TextTrackCue { attribute double startTime; attribute double endTime;

Page 198: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.

Timed MetadataTextTrackCue

interface TextTrackCue { attribute double startTime; attribute double endTime; attribute EventListener onenter;

Page 199: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.

Timed MetadataTextTrackCue

interface TextTrackCue { attribute double startTime; attribute double endTime; attribute EventListener onenter; attribute EventListener onexit;

Page 200: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.

Timed MetadataTextTrackCue

interface TextTrackCue { attribute double startTime; attribute double endTime; attribute EventListener onenter; attribute EventListener onexit;}

Page 201: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.

Timed MetadataWebKitDataCue

interface WebKitDataCue : TextTrackCue { readonly attribute DOMString type; attribute any value; }

Page 202: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.

Timed MetadataWebKitDataCue types

com.apple.quicktime.udta com.apple.quicktime.mdta com.apple.itunes org.mp4ra org.id3

Page 203: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.

Timed MetadataWebKitDataCue values

value = { key: String data: String | Array | Number | ArrayBuffer | … locale: String }

Page 204: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.

Timed MetadataUse cases

Display current title information

Track enter and exit points

Page 205: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.

DemoTimed Metadata

Brent Fulgham WebKit Engineer

Page 206: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.

Summary

Page 207: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.

Summary

Safari on iOS is closer to Safari on OS X

Page 208: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.

Summary

Safari on iOS is closer to Safari on OS X

Use HLS to stream adaptive media

Page 209: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.

Summary

Safari on iOS is closer to Safari on OS X

Use HLS to stream adaptive media

Improve power efficiency in fullscreen

Page 210: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.

Summary

Safari on iOS is closer to Safari on OS X

Use HLS to stream adaptive media

Improve power efficiency in fullscreen

Event-driven media playback with Timed Metadata

Page 211: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.

More Information

Evangelism [email protected]

!

Documentation https://developer.apple.com/safari/

Apple Developer Forums http://devforums.apple.com

Page 212: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.

Related Sessions

• Harnessing Metadata in Audiovisual Media Pacific Heights Tuesday 2:00PM

• Writing Energy Efficient Code, Part 1 Russian Hill Wednesday 10:15AM

• Designing Responsive Web Experiences Marina Friday 10:15AM

Page 213: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.

Labs

• Safari and WebKit Lab Media Lab B Tuesday 4:30PM

• Safari and WebKit Lab Media Lab B Wednesday 4:30PM

• HTTP Live Streaming Lab Media Lab A Thursday 9:00AM

• Safari and WebKit Lab Media Lab B Thursday 2:00PM

Page 214: Advanced Media for the Web - Apple Inc.€¦ · Delivering audio and video using web standards Advanced HTML5 media controllers in Safari Advanced effects with HTML5 media technologies.