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

複数のライブ映像を同期再生するのが大変だったので知見をお伝えします / iOSDC Japan 2018

FromAtom
August 31, 2018

複数のライブ映像を同期再生するのが大変だったので知見をお伝えします / iOSDC Japan 2018

iOSDC Japan 2018
2018/08/31 10:50~
Track C

FromAtom

August 31, 2018
Tweet

More Decks by FromAtom

Other Decks in Technology

Transcript

  1. • FromAtom / @FromAtom / id:FromAtom • ͸ͯͳΠϯλʔϯˠ͸ͯͳΞϧόΠτˠϐΫγϒ • pixiv

    Sketch / pixiv Sketch LIVE / pixivίϛοΫ • Swift 1.2 ͔ΒiOSΞϓϦ։ൃͷੈք΁   ࣗݾ঺հ
  2.   iOSͰಈը࠶ੜ͢Δ ࢀߟɿ [iOS] iOSͰಈըΛ࠶ੜ͢Δ̐ͭͷํ๏ | Developers.IO (https://dev.classmethod.jp/smartphone/ios-video/) ࠶ੜํ๏

    ൑அج४ ࣮૷ίετ MPMoviePlayerController iOS9 ͔Β Deprecated - WKWebView ؆୯ʹαοͱग़͍ͨ࣌͠ খ AVPlayerViewController WKWebViewΑΓগ͚ͩ͠ڽΓ͍ͨ࣌ খ AVPlayer ෳࡶͳ੍ޚɾදࣔΛߦ͍͍ͨ࣌ େ
  3.   ͜ͷൃදͷํ਑ • ϥΠϒ഑৴͞Ε͍ͯΔHLSಈըͷ࿩Λ͠·͢ • ࣮૷ํ๏͸ WWDC 2017ͷ "Advances

    in HTTP Live Streaming" Ͱ΄΅෼͔Δ • αϯϓϧίʔυ΋͋Γ·͢ • ͳͷͰৄ͍࣮͠૷ͷ࿩͸ͤͣɺίπ΍ϊ΢ϋ΢Λڞ༗͠·͢ • কདྷෳ਺HLSΛಉظ࠶ੜ͢Δ࣌ͷखॿ͚ʹͳΔࢿྉΛ໨ࢦ͢ ࢀߟɿ Advances in HTTP Live Streaming - WWDC2017 (https://developer.apple.com/videos/play/wwdc2017/504/)
  4.   KVOͷίπ • removeObserver ͤͣʹഁغ͢Δͱ࣮ߦ࣌Ϋϥογϡ • iOS9 ͔Β NotificationCenter

    ͷ removeObserver ͸ෆཁʹͳ͚ͬͨͲKVO͸ผ ࢀߟɿiOS9Ҏ߱Ͱ͸ "NotificationCenter.default.removeObserver(_:name:object:)" Λdeinitʹॻ͔ͳͯ͘΋ྑ͍Ͱ͢Αɻ(https://fromatom.hatenablog.com/entry/2017/12/13/135542)
  5.   KVOͷίπ • addObserver ͍ͯ͠ͳ͍ঢ়ଶͰ removeObserver ͢Δͱ࣮ߦ࣌Ϋϥογϡ • addObserver

    ͞Ε͍ͯΔ͔஌Δํ๏͕ͳͦ͞͏ • DispatchQueueͱϑϥάΛ༻͍ͯஸೡʹ؅ཧ͢Δඞཁ͕͋Δ
  6.   iOS 9 ͷαϙʔτΛ੾Δ • ಉظ࠶ੜʹඞཁͳAPI͕ iOS 10+ •

    iOS 9 ҎલͰ͸Ͳ͏͕Μ͹ͬͯ΋ແཧ • શͯͷಈըΛಉ࣌ʹϦϩʔυͯٙ͠ࣅಉظͳͲ͸ՄೳʢζϨΔʣ • ΋͘͠͸ iOS 9 ͷ৔߹͚ͩಈըΛݟΕͳ͘͢Δ
  7.   ઃܭͷίπ • View (VC) ʹσʔλ͕ີ݁߹͠΍͍͢ • ෳ਺ͷಈը (UIView)

    ͕ີ݁߹ͯ͠େมʹͳΔʢͳͬͨʣ • ManagerΛ࡞ΓಉظʹඞཁͳσʔλΛView֎ʹग़͢ • γϯάϧτϯ or ಈըΛ؅ཧ͢ΔView (VC) ʹΠϯελϯεΛ΋ͨͤΔ
  8.   ࢠͷಈը͕࠶ੜ͞Εͳ͍ • ಉظ࠶ੜʹ͸HLSͷ EXT-X-PROGRAM-DATE-TIME λάΛ࢖͏ • ͜ͷλάͰࢦఆ͞Ε͕ͨ࣌ؒͣΕ͍ͯͨ •

    ͲͷϨΠϠʔͷ໰୊͔Θ͔ΒͣɺݪҼڀ໌ʹ͕͔͔࣌ؒͬͨ • αʔόαΠυͱͷίϛϡχέʔγϣϯ͕େࣄ ࢀߟɿHLS WWDC 2017 Preliminary spec (https://developer.apple.com/streaming/HLS-WWDC-2017-Preliminary-Spec.pdf)
  9.   AVPlayerItemErrorLogEvent.errorComment ͷத਎ Failure Error Code Authentication failures 401

    Unauthorized Client doesn’t have permissions 403 Forbidden Resource unavailable but may become available in the future 404 Not Found Resource unavailable and will never become available in the future 410 Gone Internal server errors 500 Internal Server Error Invalid response from gateway 502 Bad Gateway Server unavailable 503 Service Unavailable Gateway timeouts 504 Gateway Time-Out ࢀߟɿError Handling Best Practices for HTTP Live Streaming - WWDC 2017 (https://developer.apple.com/videos/play/wwdc2017/514/?time=218)