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
930
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
Swiftコードバトル必勝法
toshi0383
0
180
Sheets API使ってみた
toshi0383
2
240
visionOSについてGlobeeが取り組んでいること
toshi0383
0
410
agile20150512-150512055145-lva1-app6892.pdf
toshi0383
0
110
たのしいAirPlay
toshi0383
1
640
Profiling using Signpost
toshi0383
2
860
AVPlayer周りの設計tips
toshi0383
6
800
cmdshelf::from("Swift")
toshi0383
3
820
tvOSのリスト系のインデックスラベルを自作してみる
toshi0383
0
590
Other Decks in Programming
See All in Programming
Quarto Clean Theme
nicetak
0
220
CSC509 Lecture 03
javiergs
PRO
0
140
NEWTにおけるiOS18対応の進め方
ryu1sazae
0
190
文化が生産性を作る
jimpei
3
530
MLOps in Mercari Group’s Trust and Safety ML Team
cjhj
1
110
(Deep|Web) Link support with expo-router
mrtry
0
160
Pydantic x Database API:turu-pyの開発
yassun7010
1
510
利用者視点で考える、イテレータとの上手な付き合い方
syumai
4
210
複数プロダクトの技術改善・クラウド移行に向き合うチームのフレキシブルなペア・モブプログラミングの実践 / Flexible Pair Programming And Mob Programming
honyanya
0
180
Vue :: Better Testing 2024
up1
1
380
DevFest Android in Korea 2024 - 안드로이드의 문단속 : 앱을 지키는 암호화 이야기
mdb1217
1
130
tsconfig.jsonの最近の新機能 ファイルパス編
uhyo
6
1.4k
Featured
See All Featured
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
231
17k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
38
2.1k
Product Roadmaps are Hard
iamctodd
PRO
48
10k
Designing on Purpose - Digital PM Summit 2013
jponch
114
6.9k
Making Projects Easy
brettharned
114
5.8k
Stop Working from a Prison Cell
hatefulcrawdad
267
20k
Mobile First: as difficult as doing things right
swwweet
222
8.8k
Fontdeck: Realign not Redesign
paulrobertlloyd
81
5.2k
GitHub's CSS Performance
jonrohan
1030
450k
Building Flexible Design Systems
yeseniaperezcruz
327
38k
Designing for Performance
lara
604
68k
Designing with Data
zakiwarfel
98
5.1k
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