Upgrade to Pro — share decks privately, control downloads, hide ads and more …

AirPlayの裏舞台

Chiharu Nameki
September 12, 2022

 AirPlayの裏舞台

iOSDC Japan 2022 day2, 20min Talk

https://fortee.jp/iosdc-japan-2022/proposal/c922031a-84b2-45de-9cac-3a05998978a9

• AirPlayとはAppleのデバイスから同一ネットワーク内の他の機器でメディアを再生する機能
• 歴史
• 直感的な操作の裏で行われていること、データの流れ
• アプリへの組み込み方

Chiharu Nameki

September 12, 2022
Tweet

More Decks by Chiharu Nameki

Other Decks in Technology

Transcript

  1. • ΠϯλʔωοτςϨϏہʢ2015೥։ہʣ • ৽͍͠ະདྷͷςϨϏʮABEMAʯ Streaming Client Team ABEMAͷ֤ରԠσόΠεͷ 
 ࠶ੜػೳΛ୲౰

    ݱࡏWഋʹ޲͚ͯฃಆத શ64ࢼ߹ແྉੜதܧʂ גࣜձࣾAbemaTV iPhone, iPad, Apple TV, Android, Android TV, Web, IPTV, Switch, Chromecast, …
  2. AirPlayͱ͸ʁ AppleͷσόΠε (iPhone, iPad, iPod touch, Mac)͔Β ಉҰωοτϫʔΫ಺ʹ͋ΔଞͷػثͰ Իָ, ࣸਅ,

    ಈըΛ࠶ੜ͢Δػೳ ϛϥʔϦϯά΍֎෦σΟεϓϨΠɾεϐʔΧʔͱͯ͠ͷར༻΋Մೳ
  3. • ϚϧνϧʔϜ࠶ੜ • ෳ਺ͷεϐʔΧʔͰಉ͡ۂΛ࠶ੜ ಉظͯ͠࠶ੜ͞ΕΔͷͰɺ޿͍෦԰͍ͬͺ͍ʹԻָΛ͔͚Δ͜ͱ͕Ͱ͖Δ • ֤෦԰ͰผͷۂΛ࠶ੜ • HomePod mini

    2୆ͰεςϨΦϖΞΛ࡞ΕΔ • Siri΍Home Kitͱͷ૬ੑ΋ྑ͍ Hey, Siri. ϦϏϯάϧʔϜͰ Upbeat Funk Pop Λ࠶ੜͯ͠ .VTJDΞϓϦͷػೳΛϑϧͰ࢖͏ʹ͸"QQMF.VTJDʹՃೖ͢΂͠
  4. • iPhoneͰΞϓϦΛόοΫάϥ΢ϯυʹͨ͠Γɺଞͷૢ࡞Λͯ͠΋ 
 AirPlay࠶ੜ͕ଓ͘ 
 • ಈըͷ৔߹͸ Sender ͱ Receiver

    ͸ 1 : 1 ෳ਺ͷػثΛબͿͱεϐʔΧʔͱͯ͠ͷར༻ʹͳΔ AirPlayಈը࠶ੜͷಛ௃
  5. 2002೥ Mac OS X v10.2 Jaguar ϦϦʔε AppleʹΑΔZero Con f

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

  6. 2005೥ Mac OS X v10.4 Tiger ϦϦʔε • Rendezvous →

    Bonjour ʹ໊শมߋ 
 2010೥ Apple TV ୈ̎ੈ୅ ൃച • ಈը࠶ੜʹରԠ͠ɺAirTunes → AirPlay ʹʂ
  7. 2017೥ AirPlay 2 ൃද • Apple TV͚ͩͰͳ͘ରԠεϚʔτTVͰ΋ಈը࠶ੜ͕Մೳʹ • tvOS 11.4Ҏ߱

    • ϚϧνϧʔϜ࠶ੜػೳ • 4K, HDR, αϥ΢ϯυα΢ϯυʹରԠ ಉ࣌ظʹApple TV 4Kൃച
  8. ରԠσόΠε (Receiver) • Apple TV ୈ̎ੈ୅ʙ • ରԠSmartTV • Mac

    2018೥͝ΖͷϞσϧҎ߱, macOS Monterey • HomePod • ରԠεϐʔΧʔ ೔ຊͰ͸ Sony, LG͕ରԠTVΛग़͍ͯ͠Δ ͜ͷϚʔΫ͕໨ҹʂ
  9. SmartTVͰͷಈըετϦʔϛϯάͷ੍໿ • SharePlay ະαϙʔτ • HLSͷཁ݅ • VariantؒͰηάϝϯτڥքΛ߹ΘͤΔ • ηάϝϯτ͸IϑϨʔϜ͔Β࢝ΊΔ

    • ్தͰνϟϯωϧϨΠΞ΢τ΍CODECͷมߋ͸ෆՄ • ϑϨʔϜϨʔτ͸൒෼΋͘͠͸ഒͷ੾Γସ͑ͷΈՄ ৄࡉ͸ WWDC19 507 HLS Authoring for AirPlay 2 Video Λࢀর
  10. 1. σόΠεͷൃݟ BonjourʹΑΔAirPlayରԠσόΠεͷൃݟ 2. ར༻ 4ͭͷར༻γφϦΦ • ࣸਅΛදࣔ • ۂΛ࠶ੜ

    • ಈըΛ࠶ੜ • ը໘ϛϥʔϦϯάɾը໘֦ு AirPlay Λߦ͏ྲྀΕ ※ γφϦΦ͝ͱʹ࣮ݱํ๏͸ҟͳΔ
  11. AirPlayͷαʔϏε _airplay._tcp _raop._tcp • RAOP = AirTunes Remote Audio Output

    Protocol • AirTunesͱͷޓ׵ੑ, ָۂ࠶ੜͷΈ 

  12. 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
  13. ۂΛAirPlay RTSP Real Time Streaming Protocol Apple Lossless౳Ͱ ΦʔσΟόοϑΝΛѹॖ Audio

    Packets DACP Digital Audio Control Protocol play , pause, stop, …
  14. ಈըΛAirPlay ίϯςϯπ ࠶ੜঢ়ଶ CDN POST /play with Video URL HTTPαʔό

    • Sender͸ಈըͷURLΛReceiverʹ౉͠ɺReceiverଆͰϑΝΠϧΛऔಘͯ͠࠶ੜ͢Δ • ίϯςϯπ͕҉߸Խ͞Ε͍ͯΔ৔߹ɺSenderΛ௨ͯ͡伴ͷॲཧΛߦ͏
  15. ࠶ੜதͷۂ΍ಈըͷ৘ใΛදࣔ ϝλσʔλΛ 
 MPNowPlayingInfoCenter ʹఏڙ let nowPlayingInfoCenter = MPNowPlayingInfoCenter.default() var

    nowPlayingInfo = nowPlayingInfoCenter.nowPlayingInfo ?? [String: Any]() nowPlayingInfo[MPMediaItemPropertyTitle] = metadata.title nowPlayingInfo[MPMediaItemPropertyArtwork] = metadata.artwork nowPlayingInfoCenter.nowPlayingInfo = nowPlayingInfo
  16. ࢀߟࢿྉ 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
  17. ͝੩ௌ͋Γ͕ͱ͏͍͟͝·ͨ͠ 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/