Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
AbemaTV iOSのダウンロード再生機能
Search
toshi0383
April 25, 2018
Programming
4
940
AbemaTV iOSのダウンロード再生機能
Streaming Conference #2での発表資料です。
https://streaming-lab.connpass.com/event/79586/
toshi0383
April 25, 2018
Tweet
Share
More Decks by toshi0383
See All by toshi0383
CoreDataはじめました
toshi0383
0
97
Swiftコードバトル必勝法
toshi0383
1
200
Sheets API使ってみた
toshi0383
2
250
visionOSについてGlobeeが取り組んでいること
toshi0383
0
430
agile20150512-150512055145-lva1-app6892.pdf
toshi0383
0
120
たのしいAirPlay
toshi0383
1
660
Profiling using Signpost
toshi0383
2
870
AVPlayer周りの設計tips
toshi0383
6
810
cmdshelf::from("Swift")
toshi0383
3
830
Other Decks in Programming
See All in Programming
『ドメイン駆動設計をはじめよう』のモデリングアプローチ
masuda220
PRO
8
540
Ethereum_.pdf
nekomatu
0
470
Macとオーディオ再生 2024/11/02
yusukeito
0
370
C++でシェーダを書く
fadis
6
4.1k
シェーダーで魅せるMapLibreの動的ラスタータイル
satoshi7190
1
480
Jakarta EE meets AI
ivargrimstad
0
230
Tauriでネイティブアプリを作りたい
tsucchinoko
0
370
型付き API リクエストを実現するいくつかの手法とその選択 / Typed API Request
euxn23
8
2.2k
TypeScript Graph でコードレビューの心理的障壁を乗り越える
ysk8hori
2
1.2k
Amazon Qを使ってIaCを触ろう!
maruto
0
410
3 Effective Rules for Using Signals in Angular
manfredsteyer
PRO
0
120
CSC509 Lecture 09
javiergs
PRO
0
140
Featured
See All Featured
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
109
49k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
169
50k
Music & Morning Musume
bryan
46
6.2k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
31
2.7k
How to Think Like a Performance Engineer
csswizardry
20
1.1k
Become a Pro
speakerdeck
PRO
25
5k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
226
22k
Documentation Writing (for coders)
carmenintech
65
4.4k
Six Lessons from altMBA
skipperchong
27
3.5k
Put a Button on it: Removing Barriers to Going Fast.
kastner
59
3.5k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
159
15k
Side Projects
sachag
452
42k
Transcript
AbemaTV iOSͷ μϯϩʔυ࠶ੜػೳ Streaming Conference #2 Apr 25, 2018 Toshihiro
Suzuki © Toshihiro Suzuki 2018 1
whoami ͱͬ͠ʔ @toshi0383 AbemaTV iOS / ৴ΫϥΠΞϯτ ࢹௌ࣭पΓͷR&D CWIP (Certified
Widevine Implementation Partner) GT SPORT, F1 © Toshihiro Suzuki 2018 2
NABShowߦ͖ͬͯ·ͨ͠ © Toshihiro Suzuki 2018 3
ΞδΣϯμ — AbemaTVͷμϯϩʔυ࠶ੜػೳͱ — AVAssetDownloadSession֓ཁ — ࣮ͷϋϚΓϙΠϯτ͍͔ͭ͘ © Toshihiro Suzuki
2018 4
AbemaTVͷμϯϩʔυ࠶ੜػೳͱ — ΦϑϥΠϯ࠶ੜ μϯϩʔυ࠶ੜ — ࠶ੜ։࢝࣌ʹϝλσʔλऔಘͱDRMͷϥΠηϯεղ ܾͳͲ — μϯϩʔμͱͯ͠AVAssetDownloadSessionΛ ༻
— iOS11+ © Toshihiro Suzuki 2018 5
AVAssetDownloadSessionͱ © Toshihiro Suzuki 2018 6
AVAssetDownloadSession֓ཁ1/2 — iOS10+ — URLSessionͷαϒΫϥε — ෳͷAVAssetDownloadTaskΛཧ — Session୯ҐͰWi-FiͷΈڐՄ͔Ͳ͏͔ࢦఆՄೳ —
όοΫάϥϯυDLʹରԠ © Toshihiro Suzuki 2018 7
AVAssetDownloadSession֓ཁ2/2 — جຊతʹλεΫฒྻʹΔ — Playback while downloading͕͍͍ײ͡Ͱ͋Δ — DLΞηοτඞཁʹԠͯࣗ͡ಈͰύʔδ͞ΕΔ —
[iOS11] AVAssetDownloadStorageManagementPolicy ͰॏཁΛઃఆՄೳ © Toshihiro Suzuki 2018 8
AbemaTVಛ༗ͷ੍ޚ — 25੍݅ݶ — FGͰॱ൪ʹDL͞ΕΔΑ͏ʹsuspend/resume => Ϣʔβ͖ͬͱݟ͍ͨॱ൪ʹDL͢Δʹҧ͍ͳ͍ — ࠷ߴը࣭DLͤͯ͞ͳ͍ master
playlistΛύʔεͯ͠720p/480pͷplaylistͲͪ Β͔ΛDL © Toshihiro Suzuki 2018 9
ॳͷ༧ © Toshihiro Suzuki 2018 10
AndroidμϯϩʔμΛϑϧεΫϥον iOSSDKͰΠʔδʔϞʔυ iOS1ϲ݄͘Β͍ૣ͘ऴΘΔͬ͠ΐ © Toshihiro Suzuki 2018 11
݁Ռ AndroidμϯϩʔμΛϑϧεΫϥονͯ͠Δ͏ͪʹ ExoPlayerʹμϯϩʔμ࣮͞ΕͨΒ݁͘͠ہͦͬͪ Λ࠾༻ ʹؔΘΒͣiOSAndroidͱಉ͘͡Β͍Ͱணɻ © Toshihiro Suzuki 2018 12
Ͳ͏ͯ͜͠͏ͳͬͨ — ઌʹ࣮͕ਐΉͱ༷ΛܾΊͳ͕ΒʹͳΔͷͰ ͕མͪΔ — AVFoundation͕ϒϥοΫϘοΫε ҙਤ௨Γಈ͔ͳ͍߹ʹσόοά͕ߤ͕ͪ͠ © Toshihiro Suzuki
2018 13
ϋϚΓϙΠϯτ © Toshihiro Suzuki 2018 14
[ϋϚΓϙΠϯτͦͷ0] URLSessionConfigurationͷύϥϝʔλػೳ͠ͳ͍ ͘͠۩ମతͳڍಈ͕ෆ໌֬ͷ͕΄ͱΜͲ - timeoutIntervalForResource ... ࣮ࡍʹtimeout͑ͯ আ͞ΕΔ͜ͱͳ͔ͬͨ - httpMaximumConnectionsPerHost
... ػೳ͠ͳ͍ © Toshihiro Suzuki 2018 15
[ϋϚΓϙΠϯτͦͷ1] 403ʹͳͬͨ߹ɺλεΫ͕runningͷ··Ԡ͠ͳ͘ ͳΔ μϯϩʔμͱͯ͠ݫີʹڍಈΛ୲อ͢Δʹɺࣄલʹ HEADϦΫΤετ͢ΔͳͲରԠ͕ඞཁͦ͏ © Toshihiro Suzuki 2018 16
[ϋϚΓϙΠϯτͦͷ2] assetTitle assetTitleʹಛఆͷจࣈΛࢦఆ͢Δͱtask͕Τϥʔʹ ͳΔorਐ·ͳ͍ # όάϨϙࡁΈ © Toshihiro Suzuki 2018
17
[ϋϚΓϙΠϯτͦͷ3] ΞϓϦΩϧ DLதʹΞϓϦΩϧ͢Δͱtask͕Ωϟϯηϧ͞ΕΔ. ෮ݩ ෆՄೳ. © Toshihiro Suzuki 2018 18
[ϋϚΓϙΠϯτͦͷ3] ΞϓϦΩϧ Apple: ʮΞϓϦΩϧͨͬͯ͜͠ͱɺλεΫΩϟϯη ϧ͍ͨͬͯ͜͠ͱͬ͠ΐʯ https://developer.apple.com/library/content/ documentation/iPhone/Conceptual/ iPhoneOSProgrammingGuide/BackgroundExecution/ BackgroundExecution.html #
όάϨϙࡁΈ © Toshihiro Suzuki 2018 19
[ϋϚΓϙΠϯτͦͷ4] iOS10 iOS10ͷΈɺಛఆͷίϯςϯπͰDL͕100%ࣦഊ͢Δ Γ͚͢Δ͕࣌ؒମແ͍ͷͰiOS10ରԠࣗମݟૹΔ ͜ͱʹ © Toshihiro Suzuki 2018 20
ࢁੵ ͍ͬͦεΫϥον͢Δํ͕ɻɻ — AVPlayer͕ϩʔΧϧύεΛड͚͚ͯ͘Εͳ͍ͨΊ ϫʔΫΞϥϯυ͕ඞཁ ͳͲͷ՝ ࠓճରԠݟૹΓ © Toshihiro Suzuki
2018 21
·ͱΊ — AVAssetDownloadSessionOSͷαϙʔτ͕ड͚ΒΕ ͯศར — ඞͣ͠ΠʔδʔϞʔυͰͳ͍͔ © Toshihiro Suzuki 2018
22
ืू Ұॹʹಇؒ͘Λืू͍ͯ͠·͢ Χʔτؒืू͍ͯ͠·͢ © Toshihiro Suzuki 2018 23
End ! © Toshihiro Suzuki 2018 24
Toshihiro Suzuki Twitter: @toshi0383 GitHub: @toshi0383 Qiita: @toshi0383 Email:
[email protected]
© Toshihiro Suzuki 2018 25