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を実際に試してみました。

Chiharu Nameki

June 14, 2021
Tweet

More Decks by Chiharu Nameki

Other Decks in Technology

Transcript

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

    גࣜձࣾAbemaTV @Ridwy CA.swift #15 WWDC21ใࠂձ ※ ެ։༻ʹൃද࣌ͷεϥΠυ͔ΒЌ൛OSͷεΫϦʔϯγϣοτ΍ಈըΛऔΓআ͍ͨΓ΅͔ͨ͠Γͨ͠όʔδϣϯͰ͢ɻΠϕϯτࢀՃऀͷํ͸ݶఆެ։ͷURL͔ΒൃදಈըΛ͝ཡʹͳΕ·͢ͷͰ߹Θͤͯ͝׆༻͍ͩ͘͞ɻ
  2. 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͕͋Δ
  3. ࠶ੜϘλϯͷॲཧ let activity = WatchingActivity(movie: movie) switch await activity.prepareForActivation() {

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

    CoordinatorΛSessionʹ݁ͼ͚ͭΔ player.playbackCoordinator.coordinateWithSession(session) session.join() } ಉظͷͨΊͷίʔυ͸͜Ε͚ͩ
  5. ࢀߟηογϣϯ 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
  6. AppleެࣜϦιʔε • Human Interface Guidelines SharePlayͷষ͕௥Ճ͞Ε͍ͯΔ • αϯϓϧίʔυ • Supporting

    Coordinated Media Playback • API ϦϑΝϨϯε • GroupActivities • AVPlaybackCoordinator
  7. WWDC21 • ڈ೥ʹҾ͖ଓ͖ΦϯϥΠϯ • ॳ೔͸KeynoteͱPlatform State of the Union •

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