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

5分でSharePlay入門

 5分でSharePlay入門

#potatotips #74 https://potatotips.connpass.com/event/214754/

- WWDC21
- iOS 15
- SharePlay
- Group Activities

0d04162c7a3c2907c059a06dbcd23cf4?s=128

tokorom

June 23, 2021
Tweet

Transcript

  1. ॴ༑ଠ:VUB5PLPSP J04UW04"QQ1SPHSBNNFS ෼Ͱ4IBSF1MBZೖ໳ QPUBUPUJQT

  2. @tokorom tokorom Spinners Inc. ॴ ༑ଠ / Yuta Tokoro

  3. "HFOEB w 4IBSF1MBZͷ֓ཁ w ಈըͷ4IBSF1MBZΛ࣮૷

  4. 4IBSF1MBZͱ͸ 'BDF5JNF௨࿩தʹ཭Εͨ৔ॴͷ༑ୡͱΞϓϦͷίϯςϯπΛڞ༗

  5. 4IBSF1MBZͱ͸ ར༻γʔϯ • Ұॹʹөը΍εϙʔπΛࢹௌ͢Δ • ήʔϜͷεʔύʔϓϨΠΛࣗຫ͢Δ • ཱྀߦͷͱ͖ͷࣸਅΛ༑ਓ΍Ո଒ͱҰॹʹݟΔ • άϧʔϓͰ͓ֆඳ͖͢Δ

    • Swift PlaygroundsͰҰॹʹSwiftΛֶͿ • ෆಈ࢈ΞϓϦͰ৽͍͠ՈͷީิΛ;ͨΓͰ୳͢ • ࣮Ոͷ྆਌͕ΞϓϦͷ࢖͍ํ͕Θ͔Βͳ͍ͷΛαϙʔτ͢Δ
  6. छͷ4IBSF1MBZ ը໘ڞ༗ ಈըɾԻָͷڞࢹௌ ΧελϜ

  7. छͷ4IBSF1MBZ ը໘ڞ༗ ಈըɾԻָͷڞࢹௌ ΧελϜ

  8. छͷ4IBSF1MBZ ը໘ڞ༗ ಈըɾԻָͷڞࢹௌ ΧελϜ

  9. ը໘ڞ༗ʹରԠ͢Δͷʹඞཁͳίʔυ͸ʁ "ߦ #ߦఔ౓ $ߦఔ౓ %ߦҎ্

  10. ը໘ڞ༗ʹରԠ͢Δͷʹඞཁͳίʔυ͸ʁ "ߦ #ߦఔ౓ $ߦఔ౓ %ߦҎ্ ͷ͸ͣʜJ04#FUBͰ͸࣮ಈΛ֬ೝͰ͖ͣະ֬ఆ

  11. ը໘ڞ༗͞Εͳ͍΋ͷ w ύεϫʔυͳͲηΩϡΞͳೖྗϑΟʔϧυ w ඞཁͳΒ֤ΞϓϦͰӅ͢΂͖ཁૉΛΧελϜՄೳ w %3.ʢ'BJS1MBZʣͰอޢ͞Εͨಈը

  12. छͷ4IBSF1MBZ ը໘ڞ༗ ಈըɾԻָͷڞࢹௌ ΧελϜ

  13. 57ΞϓϦͷྫ

  14. 57ΞϓϦͷྫ

  15. 57ΞϓϦͷྫ

  16. ಈըͷ4IBSF1MBZʹରԠ͢Δͱ w %3.Ͱอޢ͞Εͨίϯςϯπ΋4IBSF w ࠶ੜɾఀࢭɾγʔΫͳͲʹΑΔ࠶ੜҐஔͷಉظ

  17. ಈըͷ4IBSF1MBZʹඞཁͳίʔυ͸ʁ "ߦ #ߦఔ౓ $ߦఔ౓ %ߦҎ্

  18. "ߦ #ߦఔ౓ $ߦఔ౓ %ߦҎ্ ಈըͷ4IBSF1MBZʹඞཁͳίʔυ͸ʁ

  19. ಈըͷ4IBSF1MBZͷ࣮૷αϯϓϧ https://github.com/tokorom/SharePlaySample

  20. ಈըͷ4IBSF1MBZͷ࣮૷αϯϓϧ struct SampleActivity: GroupActivity { static let movieURL: URL? =

    URL(string: "...") static let activityIdentifier = "..." var metadata: GroupActivityMetadata { var metadata = GroupActivityMetadata() metadata.fallbackURL = Self.movieURL metadata.title = "Sample" metadata.subtitle = "WWDC19 Session Video" return metadata } } (SPVQ"DUJWJUZΛ༻ҙ
  21. ಈըͷ4IBSF1MBZͷ࣮૷αϯϓϧ let activity = SampleActivity() async { switch await activity.prepareForActivation()

    { case .activationDisabled: break case .activationPreferred: activity.activate() case .cancelled: break default: () } } (SPVQ"DUJWJUZΛΞΫςΟϕʔτ
  22. ಈըͷ4IBSF1MBZͷ࣮૷αϯϓϧ async { for await session in SampleActivity.sessions() { player.playbackCoordinator.coordinateWithSession(session)

    session.join() } } "71MBZFSͷಉظઃఆ
  23. ͦͷଞ w 1JDUVSFJO1JDUVSFͷαϙʔτ w 4IBSF1MBZதͷಈըΛςϨϏʹ"JS1MBZ w Ұ෦ͷϢʔβʔ͚ͩಈըΛר͖໭͢ʢҰ࣌తʹಉظ͠ͳ͍ʣͳͲͷΧελϜ w $.ͳͲ͕ڬ·ΕΔಈը΁ͷରॲ w

    "71MBZFSҎ֎ͷΧελϜಈըϓϨΠϠʔͷαϙʔτ w ࠶ੜಉظʹؔΘΒͳ͍ࣗ༝ͳΠϕϯτૹड৴ w ΞϓϦΛΠϯετʔϧ͍ͯ͠ͳ͍ϢʔβʔΛ"QQ4UPSFʹ༠ಋ w αΠϯΞοϓ΍ߪೖ͕ඞཁͳ৔߹ͷରॲ w 8FCϖʔδʢNBD04ͷ4BGBSJʣͰͷϝσΟΞڞࢹௌͷαϙʔτʂ
  24. w .FFU(SPVQ"DUJWJUJFT w $PPSEJOBUFNFEJBFYQFSJFODFTXJUI(SPVQ"DUJWJUJFT w #VJMEDVTUPNFYQFSJFODFTXJUI(SPVQ"DUJWJUJFT .PSF*OGPSNBUJPO w %FTJHOGPS(SPVQ"DUJWJUJFT IUUQTEFWFMPQFSBQQMFDPNWJEFPTQMBZXXED

    IUUQTEFWFMPQFSBQQMFDPNWJEFPTQMBZXXED IUUQTEFWFMPQFSBQQMFDPNWJEFPTQMBZXXED IUUQTEFWFMPQFSBQQMFDPNWJEFPTQMBZXXED w $PPSEJOBUFNFEJBQMBZCBDLJO4BGBSJXJUI(SPVQ"DUJWJUJFT IUUQTEFWFMPQFSBQQMFDPNWJEFPTQMBZXXED ˞ຊࢿྉʹܝࡌ͍ͯ͠ΔεΫϦʔϯγϣοτ͸্ه88%$ηογϣϯϏσΦΑΓൈਮͨ͠΋ͷͰ͢