Slide 1

Slide 1 text

AirPlayͷཪ෣୆ ߦ໦ ઍय़ʢͳΊ͖ ͪ͸ΔʣTwitter, GitHub @Ridwy Streaming Client Team, גࣜձࣾ AbemaTV iOSDC JAPAN 2022, day2 (9/12)

Slide 2

Slide 2 text

• ΠϯλʔωοτςϨϏہʢ2015೥։ہʣ • ৽͍͠ະདྷͷςϨϏʮABEMAʯ Streaming Client Team ABEMAͷ֤ରԠσόΠεͷ 
 ࠶ੜػೳΛ୲౰ ݱࡏWഋʹ޲͚ͯฃಆத શ64ࢼ߹ແྉੜதܧʂ גࣜձࣾAbemaTV iPhone, iPad, Apple TV, Android, Android TV, Web, IPTV, Switch, Chromecast, …

Slide 3

Slide 3 text

AirPlayͱ͸ʁ AppleͷσόΠε (iPhone, iPad, iPod touch, Mac)͔Β ಉҰωοτϫʔΫ಺ʹ͋ΔଞͷػثͰ Իָ, ࣸਅ, ಈըΛ࠶ੜ͢Δػೳ ϛϥʔϦϯά΍֎෦σΟεϓϨΠɾεϐʔΧʔͱͯ͠ͷར༻΋Մೳ

Slide 4

Slide 4 text

ද෣୆͔Βݟ͍͖ͯ·͠ΐ͏

Slide 5

Slide 5 text

iPhone͔ΒApple TVͰۂΛ࠶ੜ

Slide 6

Slide 6 text

No content

Slide 7

Slide 7 text

AirPlayͷϚʔΫΛλοϓͯ͠ ग़ྗઌΛબͿ͚ͩ

Slide 8

Slide 8 text

iPhone͔Β2୆ͷεϐʔΧʔͰಉ͡ۂΛ࠶ੜ

Slide 9

Slide 9 text

MacʹAirPlayΛઃఆ macOS MontereyҎ߱ɺMacʹ΋AirPlayՄೳʂ

Slide 10

Slide 10 text

No content

Slide 11

Slide 11 text

• ϚϧνϧʔϜ࠶ੜ • ෳ਺ͷεϐʔΧʔͰಉ͡ۂΛ࠶ੜ ಉظͯ͠࠶ੜ͞ΕΔͷͰɺ޿͍෦԰͍ͬͺ͍ʹԻָΛ͔͚Δ͜ͱ͕Ͱ͖Δ • ֤෦԰ͰผͷۂΛ࠶ੜ • HomePod mini 2୆ͰεςϨΦϖΞΛ࡞ΕΔ • Siri΍Home Kitͱͷ૬ੑ΋ྑ͍ Hey, Siri. ϦϏϯάϧʔϜͰ Upbeat Funk Pop Λ࠶ੜͯ͠ .VTJDΞϓϦͷػೳΛϑϧͰ࢖͏ʹ͸"QQMF.VTJDʹՃೖ͢΂͠

Slide 12

Slide 12 text

iPhone͔ΒApple TVͰಈըΛ࠶ੜ

Slide 13

Slide 13 text

No content

Slide 14

Slide 14 text

• iPhoneͰΞϓϦΛόοΫάϥ΢ϯυʹͨ͠Γɺଞͷૢ࡞Λͯ͠΋ 
 AirPlay࠶ੜ͕ଓ͘ 
 • ಈըͷ৔߹͸ Sender ͱ Receiver ͸ 1 : 1 ෳ਺ͷػثΛબͿͱεϐʔΧʔͱͯ͠ͷར༻ʹͳΔ AirPlayಈը࠶ੜͷಛ௃

Slide 15

Slide 15 text

iPhoneͷࣸਅΛେը໘Ͱʂ

Slide 16

Slide 16 text

No content

Slide 17

Slide 17 text

ը໘ϛϥʔϦϯάɾը໘֦ு ஗Ԇ͕ؾʹͳΔਓʹ͸༗ઢωοτϫʔΫ͕͓͢͢Ί

Slide 18

Slide 18 text

AirPlayͷཪ෣୆

Slide 19

Slide 19 text

ྺ࢙

Slide 20

Slide 20 text

2002೥ Mac OS X v10.2 Jaguar ϦϦʔε AppleʹΑΔZero Con f iguration Networkingٕज़ɺ Rendezvous (ϥϯσϒʔ)Λ౥ࡌ Zero Con f iguration Networkingٕज़ͱ͸ • ෳࡶͳωοτϫʔΫઃఆͳ͠ʢ= Zero Con f igurationʣͰ 
 ಉҰωοτϫʔΫ্ʹ͋ΔಛఆͷσόΠεΛൃݟͰ͖Δٕज़ • ଞʹ͸ϚΠΫϩιϑτͷUPnPͳͲ 


Slide 21

Slide 21 text

2004೥ AirMac Express ൃച • iTunesͷۂΛωοτϫʔΫܦ༝ͰετϦʔϛϯά࠶ੜ͢ΔAirTunesػೳ • σόΠεݕग़ʹ͸ Rendezvous Λར༻ (࢓༷ඇެ։) ˞೔ຊҎ֎Ͱ͸"JS1PSU&YQSFTT

Slide 22

Slide 22 text

2005೥ Mac OS X v10.4 Tiger ϦϦʔε • Rendezvous → Bonjour ʹ໊শมߋ 
 2010೥ Apple TV ୈ̎ੈ୅ ൃച • ಈը࠶ੜʹରԠ͠ɺAirTunes → AirPlay ʹʂ

Slide 23

Slide 23 text

2017೥ AirPlay 2 ൃද • Apple TV͚ͩͰͳ͘ରԠεϚʔτTVͰ΋ಈը࠶ੜ͕Մೳʹ • tvOS 11.4Ҏ߱ • ϚϧνϧʔϜ࠶ੜػೳ • 4K, HDR, αϥ΢ϯυα΢ϯυʹରԠ ಉ࣌ظʹApple TV 4Kൃച

Slide 24

Slide 24 text

ରԠσόΠε (Receiver) • Apple TV ୈ̎ੈ୅ʙ • ରԠSmartTV • Mac 2018೥͝ΖͷϞσϧҎ߱, macOS Monterey • HomePod • ରԠεϐʔΧʔ ೔ຊͰ͸ Sony, LG͕ରԠTVΛग़͍ͯ͠Δ ͜ͷϚʔΫ͕໨ҹʂ

Slide 25

Slide 25 text

SmartTVͰͷಈըετϦʔϛϯάͷ੍໿ • SharePlay ະαϙʔτ • HLSͷཁ݅ • VariantؒͰηάϝϯτڥքΛ߹ΘͤΔ • ηάϝϯτ͸IϑϨʔϜ͔Β࢝ΊΔ • ్தͰνϟϯωϧϨΠΞ΢τ΍CODECͷมߋ͸ෆՄ • ϑϨʔϜϨʔτ͸൒෼΋͘͠͸ഒͷ੾Γସ͑ͷΈՄ ৄࡉ͸ WWDC19 507 HLS Authoring for AirPlay 2 Video Λࢀর

Slide 26

Slide 26 text

௚ײతͳૢ࡞ͷཪͰ ͲΜͳ͜ͱ͕͓͜ͳΘΕ͍ͯΔͷ͔ʁ

Slide 27

Slide 27 text

1. σόΠεͷൃݟ BonjourʹΑΔAirPlayରԠσόΠεͷൃݟ 2. ར༻ 4ͭͷར༻γφϦΦ • ࣸਅΛදࣔ • ۂΛ࠶ੜ • ಈըΛ࠶ੜ • ը໘ϛϥʔϦϯάɾը໘֦ு AirPlay Λߦ͏ྲྀΕ ※ γφϦΦ͝ͱʹ࣮ݱํ๏͸ҟͳΔ

Slide 28

Slide 28 text

σόΠεͷൃݟ

Slide 29

Slide 29 text

Bonjour ෳࡶͳઃఆͳ͠ʹɺϩʔΧϧωοτϫʔΫ಺Ͱ ໨తͷػೳʢαʔϏεʣΛఏڙ͢ΔΠϯελϯεΛݕग़͢Δ࢓૊Έ ϋʔυ΢ΣΞ͕ෳ਺ͷαʔϏεΛఏڙ͢Δࣄ͸ Α͋͘ΔͷͰɺσόΠεͰ͸ͳ͘ ʮػೳΛఏڙ͢ΔΠϯελϯεʯͱ͍͏୯ҐͰѻ͏

Slide 30

Slide 30 text

AirPlayͷαʔϏε _airplay._tcp _raop._tcp • RAOP = AirTunes Remote Audio Output Protocol • AirTunesͱͷޓ׵ੑ, ָۂ࠶ੜͷΈ 


Slide 31

Slide 31 text

Multicast DNS (mDNS)ͷϨίʔυΛ׆༻ mDNS • খ͞ͳωοτϫʔΫ಺ͰɺDNSͷ୅ΘΓʹϗετ໊͔ΒIPΞυϨεΛղܾ • ֤σόΠε্ͰϨεϙϯμʔ্ཱ͕͕͓ͪͬͯΓɺϚϧνΩϟετͰ΍ΓͱΓ͢Δ 
 mDNSͷϨίʔυʹΠϯελϯεͱαʔϏεͷϚοϐϯάΛొ࿥ 
 (Publication)

Slide 32

Slide 32 text

AirPlay Sender AirPlayͰ͖Δਓʙʂ 🙋 ŰŖŘ 🙋 ŰŖŘ Local Network ※ ݫີͰ͸͋Γ·ͤΜ͕͜ΜͳΠϝʔδͰ͢

Slide 33

Slide 33 text

Bonjourݕग़ αʔϏε _airplay._tcp Λఏڙ͍ͯ͠ΔΠϯελϯε͸͍Δʁ NiceSpeaker._airplay._tcp.local ݕग़ ໊લղܾ NiceSpeaker._airplay._tcp.local ͷϗετ໊, ϙʔτ NiceSpeaker._airplay._tcp.local ϗετ໊: NiceSpeaker.local ϙʔτ: 1010 NiceSpeaker.local, 1010 NiceSpeaker.localͷIPΞυϨε AirPlay Sender

Slide 34

Slide 34 text

ར༻γφϦΦຖͷཪଆ ⚠ UNDOCUMENTED ϦόʔεΤϯδχΞϦϯά͞Ε͍ͯΔॳظͷ࢓༷Λݩʹ͍ͯ͠·͢

Slide 35

Slide 35 text

ࣸਅΛAirPlay HTTPαʔό PUT /photo ࣸਅΞϓϦ ը૾ϑΝΠϧ ※ ͜ͷػೳ͸3rd Partyʹ͸ެ։͞Ε͍ͯͳ͍

Slide 36

Slide 36 text

ۂΛAirPlay RTSP Real Time Streaming Protocol Apple Lossless౳Ͱ ΦʔσΟόοϑΝΛѹॖ Audio Packets DACP Digital Audio Control Protocol play , pause, stop, …

Slide 37

Slide 37 text

ಈըΛAirPlay ίϯςϯπ ࠶ੜঢ়ଶ CDN POST /play with Video URL HTTPαʔό • Sender͸ಈըͷURLΛReceiverʹ౉͠ɺReceiverଆͰϑΝΠϧΛऔಘͯ͠࠶ੜ͢Δ • ίϯςϯπ͕҉߸Խ͞Ε͍ͯΔ৔߹ɺSenderΛ௨ͯ͡伴ͷॲཧΛߦ͏

Slide 38

Slide 38 text

ϛϥʔϦϯάɾը໘֦ு ը໘ɾԻ੠Λ 
 HWΤϯίʔμͰѹॖ Packets

Slide 39

Slide 39 text

ΞϓϦʹAirPlayΛ૊ΈࠐΉ

Slide 40

Slide 40 text

࣮͸ AVPlayer ΍ WebView Λ࢖͍ͬͯΕ͹ Կ΋͠ͳͯ͘΋AirPlay͞ΕΔʂ ग़ྗܦ࿏ͷ؅ཧ͸OSͷ࢓ࣄ

Slide 41

Slide 41 text

εϓϥογϡ΍ϓϨϏϡʔಈըͳͲɺ खݩͷ୺຤ͷUIͷதͰ࠶ੜ͞Εͯཉ͍͠΋ͷ͸ϑϥάΛ false ʹ • AVPlayer allowsExternalPlayback • WKWebView allowsAirPlayForMediaPlayback Ή͠ΖɺAirPlay͠ͳ͍ͨΊͷϑϥά͕͋Δ

Slide 42

Slide 42 text

ΑΓྑ͍ମݧͷͨΊͷνϡʔχϯά

Slide 43

Slide 43 text

AirPlayઌͷબ୒ը໘Λදࣔ 
 AVRoutePickerView Λදࣔ let routePickerView = AVRoutePickerView() // ಈը࠶ੜՄೳͳσόΠεΛ༏ઌ͢Δ iOS 13Ҏ߱ routePickerView.prioritizesVideoDevices = true

Slide 44

Slide 44 text

ΞϓϦΛดͯ͡΋࠶ੜΛଓ͚Δ Info.plistͰόοΫάϥ΢ϯυ࠶ੜΛ༗ޮԽ

Slide 45

Slide 45 text

ΞϓϦ֎͔Βͷૢ࡞ΛՄೳʹ ϩοΫը໘΍ίϯτϩʔϧηϯλʔɺAirPlayઌ … MPRemoteCommandCenter ͰΠϕϯτΛड͚औͬͯ࠶ੜΛ੍ޚ

Slide 46

Slide 46 text

࠶ੜதͷۂ΍ಈըͷ৘ใΛදࣔ ϝλσʔλΛ 
 MPNowPlayingInfoCenter ʹఏڙ let nowPlayingInfoCenter = MPNowPlayingInfoCenter.default() var nowPlayingInfo = nowPlayingInfoCenter.nowPlayingInfo ?? [String: Any]() nowPlayingInfo[MPMediaItemPropertyTitle] = metadata.title nowPlayingInfo[MPMediaItemPropertyArtwork] = metadata.artwork nowPlayingInfoCenter.nowPlayingInfo = nowPlayingInfo

Slide 47

Slide 47 text

• AirPlayͱ͸ʁ ԻָɾࣸਅɾಈըΛଞͷػثͰ؆୯ʹ࠶ੜ + ϛϥʔϦϯάɾը໘֦ு • ྺ࢙ͱͦΕͧΕͷମݧͷཪଆ Bonjour, RTSP, … • ΞϓϦ΁ͷ૊ΈࠐΈํ ·ͱΊ

Slide 48

Slide 48 text

ࢀߟࢿྉ WWDC Sessions WWDC19 Session 501 Reaching the. Big Screen with AirPlay 2 WWDC19 Session 507 HLS Authoring for AirPlay 2 Video Apple։ൃऀ޲͚ϖʔδ 
 https://developer.apple.com/airplay/ 
 openairplay AirPlayͷϦόʔεΤϯδχΞϦϯά 
 https://openairplay.github.io

Slide 49

Slide 49 text

͝੩ௌ͋Γ͕ͱ͏͍͟͝·ͨ͠ Big Buck Bunny Copyright (C) 2008 Blender Foundation | peach.blender.org Some Rights Reserved. Creative Commons Attribution 3.0 license. https://peach.blender.org/ Springish by Gillicuddy CC BY-NC 3.0 https://freemusicarchive.org/music/gillicuddy/Plays_Guitar/05-springish/ Upbeat Funk Pop by Scott Holmes Music CC BY-NC 4.0 https://freemusicarchive.org/music/Scott_Holmes/indie-pop-acoustic-background- music/upbeat-funk-pop-1/