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

検証 SharePlay media playback

検証 SharePlay media playback

発表イベント : CA.swift #15 WWDC21報告会
https://cyberagent.connpass.com/event/215215/

WWDC21で発表されたSharePlayを実際に試してみました。

4ef794bdea63fc6153845bb26bac38a2?s=128

Chiharu Nameki

June 14, 2021
Tweet

Transcript

  1. ݕূ SharePlay media playback 2021/07/14 ߦ໦ ઍय़ Streaming Client Team,

    גࣜձࣾAbemaTV @Ridwy CA.swift #15 WWDC21ใࠂձ ※ ެ։༻ʹൃද࣌ͷεϥΠυ͔ΒЌ൛OSͷεΫϦʔϯγϣοτ΍ಈըΛऔΓআ͍ͨΓ΅͔ͨ͠Γͨ͠όʔδϣϯͰ͢ɻΠϕϯτࢀՃऀͷํ͸ݶఆެ։ͷURL͔ΒൃදಈըΛ͝ཡʹͳΕ·͢ͷͰ߹Θͤͯ͝׆༻͍ͩ͘͞ɻ
  2. SharePlayͱ͸ • FaceTime௨࿩தʹ཭Εͨ૬खͱ ಉ͡ମݧΛڞ༗Ͱ͖Δػೳ • ಈըɾԻָɾΞϓϦಠࣗͷମݧ 
 • iOS 15,

    tvOS 15, macOS 12Ҏ߱ • Safari 15Ҏ߱ shareplay SF symbol
  3. Social-Viewing Co-Viewing Ո଒΍༑ਓͰөը΍εϙʔπ؍ઓͳͲΛָ͠Ήମݧ ཭Ε͍ͯͯ΋Ұॹʂ SharePlay͸͜ΕΛFaceTime্Ͱ࣮ݱ͢Δ

  4. SharePlay media playback IS NOT ࠶഑৴ 
 ίϯςϯπࣗମ͸͜Ε·Ͱ௨Γ֤αʔϏεͷ࢓૊ΈͰ഑৴ ࠶ੜλΠϛϯάΛίϯτϩʔϧ

  5. ࢓૊Έ

  6. GroupActivities API

  7. GroupActivities API FaceTime։࢝ʂ FaceTime௨࿩

  8. GroupActivity ڞ༗͢Δମݧ GroupActivities API ࡞੒ FaceTime௨࿩

  9. GroupActivity ڞ༗͢Δମݧ GroupActivities API activate() FaceTime௨࿩

  10. GroupActivity ڞ༗͢Δମݧ GroupActivities API GroupSession FaceTime௨࿩

  11. GroupActivity ڞ༗͢Δମݧ GroupActivities API GroupSession FaceTime௨࿩ join() join() join()

  12. ࠶ੜλΠϛϯάͷಉظ AVPlaybackCoordinator Appleެࣜαϯϓϧίʔυ Supporting Coordinated Media Playback ͷυΩϡϝϯτΑΓ GroupSessionΛ௨ͯ͡ Coordinator͕࠶ੜɾఀࢭɾγʔΫ

    ͳͲͷΠϕϯτΛ΍ΓͱΓ
  13. ͬ͘͟Γݴ͏ͱ શһͷ࠶ੜ४උ͕ग़དྷͨΒ ʮͤʔͷʂʯͰ։࢝͢Δ ࠶ੜλΠϛϯάͷಉظ AVPlaybackCoordinator

  14. ͬ͘͟Γݴ͏ͱ શһͷ࠶ੜ४උ͕ग़དྷͨΒ ʮͤʔͷʂʯͰ։࢝͢Δ AVPlaybackCoordinator ࠶ੜλΠϛϯάͷಉظ

  15. HTTP Live StreamingΛಉظ͢Δʹ͸ AVPlaybackCoordinator ϓϨΠϦετʹEXT-X-PROGRAM-DATE-TIMEλάΛهड़ #EXT-X-PROGRAM-DATE-TIME:<YYYY-MM-DDThh:mm:ss.SSSZ> ࣍ͷηάϝϯτͷઌ಄Λઈର࣌ࠁͱ݁ͼ͚ͭΔ

  16. Coding…

  17. struct Movie: Hashable, Codable { var url: URL var title:

    String } struct WatchingActivity: GroupActivity { let movie: Movie var metadata: GroupActivityMetadata { var metadata = GroupActivityMetadata() metadata.type = .watchTogether metadata.fallbackURL = movie.url metadata.title = movie.title return metadata } } ActivityΛఆٛ GroupActivityϓϩτίϧʹ४ڌͤ͞Δ GroupActivity͸CodableΛܧঝ activate࣌ʹencode, decodeͯ͠ ࢀՃऀʹಧ͚ΒΕΔ ϝλσʔλ͸ΧʔυͳͲʹදࣔ͞ΕΔ SafariͰ͸fallbackURL͕։͔ΕΔ ଞʹ͸.listenTogether, .generic͕͋Δ
  18. ࠶ੜϘλϯͷॲཧ let activity = WatchingActivity(movie: movie) switch await activity.prepareForActivation() {

    case .activationDisabled: // SharePlayՄೳͰͳ͍৔߹͸͙͢͜͜ʹདྷΔ case .activationPreferred: activity.activate() case .cancelled: break default: () }
  19. Sessionͷ։࢝Λ؂ࢹͯ͠Join for await session in WatchingActivity.sessions() { // ࠶ੜUIͷηοτΞοϓΛߦ͏ //

    CoordinatorΛSessionʹ݁ͼ͚ͭΔ player.playbackCoordinator.coordinateWithSession(session) session.join() } ಉظͷͨΊͷίʔυ͸͜Ε͚ͩ
  20. ΞϓϦಠࣗͷମݧΛγΣΞ͢Δ৔߹ GroupSessionMessenger • ΍ΓͱΓ͢ΔΠϕϯτΛఆٛ • GroupSessionMessengerΛར༻ͯ͠SessionʹΠϕϯτΛpost

  21. ରԠ༧ఆͷαʔϏε WWDC21 KeynoteΑΓ

  22. ͍Ζ͍Ζࢼͯ͠Έ·͠ΐ͏

  23. ΞϓϦΛ͍࣋ͬͯͳ͔ͬͨΒʁ • ࢀՃϘλϯ͕App Store΁ͷಋઢʹͳΔ • ༑ୡ͕଴͍ͬͯΔͷͰͰ͖Δ͚ͩૣ͘ࢹௌͰ͖ΔΑ͏ʹUXΛઃܭ

  24. ඇରԠσόΠε(iOS 15ະຬͷiPhoneͳͲ) ͷϝϯόʔ͕͍ͨΒʁ • ରԠσόΠεؒͰSharePlay͕Մೳ • ඇରԠσόΠεͰ͸ͳʹ΋ى͖ͳ͍ iOS 15 β2Ͱݕূ

    iOS 14.6 iOS 15 FaceTime͠ͳ͕ΒSharePlayͰಈըࢹௌத
  25. ࣈນ΍Ի੠͸ʁ • ͋͘·Ͱௐ੔͞ΕΔͷ͸࠶ੜλΠ ϛϯά • ֤͕ࣗͦΕͧΕ͖͢ͳࣈນ΍Ի੠ Λબ୒Մೳ υʔφοπͷ݀ʹ͍ͭͯ About donut

    hole
  26. ޿ࠂ͋Γɾͳ͠ͷϓϥϯͷϢʔβ ͕ࠞࡏ͍ͯͨ͠ΒͲ͏͢Δ΂͖ʁ • ύʔιφϥΠζ͞Εͨ޿ࠂ͸ϝ ΠϯͷίϯςϯπͷಉظʹӨڹ ͠ͳ͍Α͏ʹผͷϓϨΠϠʔͰ ࠶ੜ • ޿ࠂ͕ऴΘͬͨΒ࠶߹ྲྀ •

    AVPlayerInterstitialEvent API (iOS 15+)͕ར༻Մೳ Ad ޿ࠂ͋Γ ޿ࠂͳ͠
  27. ಉظͷਫ਼౓͸ʁ • ίϯτϩʔϧΠϕϯτͷ΍ΓͱΓʹ͸ؾʹͳΔ΄Ͳͷ஗Ԇ͸ͳ͍ 
 ʢϦϦʔεޙͲ͏͔ʁʣ • ίϯςϯπͷಉظͷਫ਼౓͸αʔϏεͷ࣮૷ʹΑΔ 
 • ݕূ࣌͸TVΞϓϦͰ਺ϑϨʔϜʙ਺ඵͷζϨ͕ݟΒΕͨ

    iOS 15 β2Ͱݕূ
  28. ࢀߟηογϣϯ WWDC21, Apple • Keynote 0:09:40 • Platforms State of

    the Union 1:05:44 • Meet Group Activities • Design for Group Activities • Coordinate media experiences with Group Activities • Build custom experiences with Group Activities • Coordinate media playback in Safari with Group Activities
  29. AppleެࣜϦιʔε • Human Interface Guidelines SharePlayͷষ͕௥Ճ͞Ε͍ͯΔ • αϯϓϧίʔυ • Supporting

    Coordinated Media Playback • API ϦϑΝϨϯε • GroupActivities • AVPlaybackCoordinator
  30. ॴײ • ͱΓ͋͑ͣ૊ΈࠐΈ͚ͩͳΒطଘ࣮૷Λେ͖͘ม͑Δ͜ͱͳ͘Մೳ • SharePlayΛػʹΠϯετʔϧͯ͘͠ΕͨϢʔβ͕εϜʔζʹࢹௌ։࢝Ͱ͖Δ ྲྀΕΛߟ͑Δඞཁ͕͋Δ • ޿ࠂͷѻ͍͕೉ͦ͠͏ • Picture-in-Pictureʹ΋ରԠ͢Δͱମݧͱͯ͠ͱͯ΋ྑ͍

  31. Slides for Ice-breaking ͓·͚

  32. WWDC21 • ڈ೥ʹҾ͖ଓ͖ΦϯϥΠϯ • ॳ೔͸KeynoteͱPlatform State of the Union •

    2೔໨Ҏ߱͸ຖ೔ηογϣϯಈը͕ެ։͞Ε͍ͯ͘ʢ४උग़དྷ࣍ୈʁʣ • 2೔໨ͷேͷஶ໊ਓΛݺΜͰߦΘΕΔεϖγϟϧΠϕϯτ͸݈ࡏ • ࠓ೥͸NASAͰՐ੕ʹߦ͘ϩέοτͷઃܭΛ͞Ε͍ͯΔঁੑٕज़ऀ Tiera Fletcher͞Μʢ·ͩ ެ։தʂʣ • 1 on 1ͷϥϘͷଞɺCoding Challenge΍ForumΛ࢖ͬͨऔΓ૊Έ΋ • εϥΠυ͕ެ։͞Εͳ͘ͳͬͯ͠·͍·͕ͨ͠ɺ͔ΘΓʹTranscript͕ศར • ΦϯϥΠϯͷԸܙͰηογϣϯͷ௕͕͞ϑϨΩγϒϧʹͳΓɺখ͞ΊͷτϐοΫ͕௥͍΍͘͢ June 7-11
  33. ಈըStreamingؔ࿈ͷτϐοΫε΋ ଟ͋͘Γ·ͨ͠

  34. HLS Interstitials • ޿ࠂΛಠཱͨ͠Ξηοτͱͯ͠ѻ͏ • Ͳͷ޿ࠂΛදࣔ͢Δ͔μΠφϛοΫʹมߋՄೳʢlate bindingʣ • ൪૊ͷ೚ҙͷҐஔʹ޿ࠂΛεέδϡʔϧՄೳ 


    DISCONTINUITYλάͷΑ͏ʹηάϝϯτͰ੾Δඞཁ͕ͳ͍ • AirPlay, Picture in Picture΋αϙʔτ 
 ैདྷͷCSAIͰ͸ࠔ೉ #EXT-X-DATERANGE:ID="ad1",CLASS="com.apple.hls.interstitial", START-DATE="2020-01-02T21:55:44.000Z",DURATION=15.0, X-ASSET-URI="http://example.com/ad1.m3u8", X-RESUME-OFFSET=0,X-RESTRICT="SKIP,JUMP" ϓϨΠϦετ΁ͷૠೖྫ (#EXT-X-ENDLIST ͷޙͳͲ)
  35. HLS Content Steering • CDNͷෛՙ෼ࢄͷٕज़ • εςΞϦϯάαʔόͰCDNͷ༏ઌॱҐͷϦετʢಈతʹมಈ͢ΔʣΛఏڙ • ಛఆͷCDNͰٸͳΞΫηε૿΍ωοτϫʔΫো֐͕ൃੜͨ࣌͠ɺεςΞϦϯ άαʔόͰฦ͢Steering

    ManifestΛௐ੔ͯ͠৽ن΋͘͠͸༨༟ͷ͋ΔCDNʹ ΫϥΠΞϯτΛ༠ಋ͢Δ #EXTM3U #EXT-X-CONTENT-STEERING:SERVER-URI="/steering?video=00012",PATHWAY-ID="CN" #EXT-X-STREAM-INF:BANDWIDTH=1280000,CODECS="avc1.640028",PATHWAY-ID="CN" https://cn.example.com/low/audio-video.m3u8 #EXT-X-STREAM-INF:BANDWIDTH=7680000,CODECS="avc1.640028",PATHWAY-ID="CN" https://jp.example.com/hi/audio-video.m3u8 #EXT-X-STREAM-INF:BANDWIDTH=1280000,CODECS="avc1.640028",PATHWAY-ID="JP" https://cn.example.com/low/audio-video.m3u8 #EXT-X-STREAM-INF:BANDWIDTH=7680000,CODECS="avc1.640028",PATHWAY-ID="JP" https://jp.example.com/hi/audio-video.m3u8 ϚελʔϓϨΠϦετهड़ྫ