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
iOSの動画アプリを作る上で押さえておきたい設計
Search
h.crane
October 25, 2019
Technology
3
760
iOSの動画アプリを作る上で押さえておきたい設計
イベント「Tech Book Conference for iOS」で登壇した内容
https://techbookconference.connpass.com/event/148487/
h.crane
October 25, 2019
Tweet
Share
More Decks by h.crane
See All by h.crane
Getting started with controlling LEGO using Swift
hcrane
1
1k
Swift 5.9 と C++ の互換性
hcrane
1
680
Live on iOSDC2023
hcrane
4
1.3k
自販機で1000円を使い切りたいんじゃ!
hcrane
0
130
Vision.framework - 商品画像からのテキスト検出と並列化実装への試み
hcrane
1
740
DevRel/Japan 2023 - 1つの事業部だけで行う DevRel とは
hcrane
0
980
R2-D2をiOSで動かす
hcrane
2
3k
iOSDC2022 - SwiftUI in UIKit で開発する世界
hcrane
6
6.9k
iOSDC2022 - iPadOSDC Japan 2022
hcrane
2
3.9k
Other Decks in Technology
See All in Technology
バックエンドエンジニアのためのフロントエンド入門 #devsumiC
panda_program
16
6.5k
2.5Dモデルのすべて
yu4u
2
610
管理者しか知らないOutlookの裏側のAIを覗く#AzureTravelers
hirotomotaguchi
1
240
FastConnect の冗長性
ocise
1
9.6k
AndroidデバイスにFTPサーバを建立する
e10dokup
0
240
Classmethod AI Talks(CATs) #15 司会進行スライド(2025.02.06) / classmethod-ai-talks-aka-cats_moderator-slides_vol15_2025-02-06
shinyaa31
0
170
インフラをつくるとはどういうことなのか、 あるいはPlatform Engineeringについて
nwiizo
5
2.1k
関東Kaggler会LT: 人狼コンペとLLM量子化について
nejumi
3
460
飲食店予約台帳を支えるインタラクティブ UI 設計と実装
siropaca
6
1.4k
アジャイル開発とスクラム
araihara
0
160
Postmanを使いこなす!2025年ぜひとも押さえておきたいPostmanの10の機能
nagix
2
120
Bounded Context: Problem or Solution?
ewolff
1
210
Featured
See All Featured
Fashionably flexible responsive web design (full day workshop)
malarkey
406
66k
The Language of Interfaces
destraynor
156
24k
Faster Mobile Websites
deanohume
306
31k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
666
120k
Producing Creativity
orderedlist
PRO
343
39k
Building Flexible Design Systems
yeseniaperezcruz
328
38k
Mobile First: as difficult as doing things right
swwweet
223
9.3k
Measuring & Analyzing Core Web Vitals
bluesmoon
6
240
Designing for humans not robots
tammielis
250
25k
Stop Working from a Prison Cell
hatefulcrawdad
267
20k
Rebuilding a faster, lazier Slack
samanthasiow
79
8.8k
jQuery: Nuts, Bolts and Bling
dougneiner
63
7.6k
Transcript
iOSの動画アプリを作る上で 押さえておきたい設計 Hiromu Tsuruta
About me 〈Company〉 - every, inc. / DELISH KITCHEN 〈Role〉
- iOS Developer 〈Account〉 - Twitter: @hcrane14 - Qiita: H_Crane
動画のお話の前に、、、 AVFoundationの制約があるって知ってました?
AVFoundationが許可できる 動画の同時接続数(再生数)に上限が! → その数は16接続まで → iOS13から32接続まで増えた! (UIKitに限る、、?)
Demo TableViewで動画を保持したセルを表示させたテスト ここだけ 動画が出ていない! つまり32個までしか 接続できないことが わかった! セルを33個生成し動画を同時再生させた時 9/15なので Xcode
beta版 セルを17個生成し動画を同時再生させた時 ここだけ 動画が動いていない! つまり16個までしか 接続できない、、 はずだった笑
「え?32個も同時に接続することなどなくない?」 → 気づいていないだけで勝手に接続されてっぞ!
① 画面遷移で奥深く進む場合はスタックされる 参考 https://www.google.com/url?sa=i&source=images&cd=&cad=rja&uact=8&ved=2ahUKEwi7x4GC8rPlAhULx4sBHcBAAzUQjhx6BAgBEAI&url=http%3A%2F%2Fharuna0503.xsrv.jp%2F2019%2F07 %2F04%2Fios-%25E7%2594%25BB%25E9%259D%25A2%25E9%2581%25B7%25E7%25A7%25BB%25E3%2581%25AE%25E7%25A8%25AE%25E9%25A1%259E%2F&psig=AOvVaw2OXL EayApH9Ad0tPInLYVy&ust=1571971474667862 画面遷移例
② 動画の広告は勝手にスタックされる 参考 https://www.google.com/url?sa=i&source=images&cd=&cad=rja&uact=8&ved=2ahUKEwjYkqbwoLLlAhXZc94KHZcYCL QQjhx6BAgBEAI&url=https%3A%2F%2Fwww.exchangewire.jp%2F2015%2F01%2F28%2Fnews-video-mobile%2F&psi g=AOvVaw0z9I5CcmN9FIFF3hFo1DrJ&ust=1571915808807843 参考 https://www.google.com/url?sa=i&source=images&cd=&cad=rja&uact=8&ved=2ahUKEwjWt8iYorLlAhWswosBHYXVDpgQjhx6BA gBEAI&url=https%3A%2F%2Fgmotech.jp%2Fnews_release%2F%3Fp%3D5121&psig=AOvVaw2RfpR8QLMvZox85TI8ikgm&ust =1571916082239556
動画リワード広告 複数の動画広告
どうやって動画の最適化すんの?
YoutubeのiOSアプリから動画最適化例を見る
動画の流れを分けてみてみると、、 検索 1回目 検索 2回目 検索 検索 動画 動画 閉じる
閉じる 動画のプレイヤーを 1つ保持 動画のプレイヤーを 使い回す
検索 検索 検索 検索 ・・・ 仕組みはシンプル 動画プレイヤー
動画のプレイヤーを管理して 制限しているだけ!
シングルトンで動画のプレイヤーを管理
RxSwift / Combine などを使用すると
https://booth.pm/ja/items/1567921 続きは 本で!
SwiftUIで動画を複数表示させた時 100個を同時に再生させても問題なかった! おまけ
謎は深まるばかり、、、 fin