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
ABEMAモバイルアプリのプレイヤーを共通化する
Search
mtnmr
February 12, 2025
Programming
0
130
ABEMAモバイルアプリのプレイヤーを共通化する
CA.aab #5での登壇資料です。
https://cyberagent.connpass.com/event/343440/
mtnmr
February 12, 2025
Tweet
Share
More Decks by mtnmr
See All by mtnmr
エンジニア1年目で複雑なコードの改善に取り組んだ話
mtnmr
4
3.9k
Other Decks in Programming
See All in Programming
開発組織の戦略的な役割と 設計スキル向上の効果
masuda220
PRO
10
1.8k
Devoxx BE - Local Development in the AI Era
kdubois
0
150
CSC305 Lecture 09
javiergs
PRO
0
320
20251016_Rails News ~Rails 8.1の足音を聴く~
morimorihoge
3
860
One Enishi After Another
snoozer05
PRO
0
170
CSC305 Lecture 11
javiergs
PRO
0
310
フロントエンド開発のためのブラウザ組み込みAI入門
masashi
7
3.6k
3年ぶりにコードを書いた元CTOが Claude Codeと30分でMVPを作った話
maikokojima
0
690
オープンソースソフトウェアへの解像度🔬
utam0k
17
3.2k
Migration to Signals, Resource API, and NgRx Signal Store
manfredsteyer
PRO
0
130
なんでRustの環境構築してないのにRust製のツールが動くの? / Why Do Rust-Based Tools Run Without a Rust Environment?
ssssota
14
47k
Towards Transactional Buffering of CDC Events @ Flink Forward 2025 Barcelona Spain
hpgrahsl
0
120
Featured
See All Featured
Embracing the Ebb and Flow
colly
88
4.9k
jQuery: Nuts, Bolts and Bling
dougneiner
65
7.9k
Gamification - CAS2011
davidbonilla
81
5.5k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
PRO
23
1.5k
Statistics for Hackers
jakevdp
799
220k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
PRO
190
55k
YesSQL, Process and Tooling at Scale
rocio
173
15k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
36
6.1k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
116
20k
Writing Fast Ruby
sferik
630
62k
[RailsConf 2023] Rails as a piece of cake
palkan
57
5.9k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
667
130k
Transcript
AbemaTV, Inc. All Rights Reserved AbemaTV, Inc. All Rights Reserved
1 ABEMAモバイルアプリの プレイヤーを共通化する 2025 February 12th たなむら (@mtnmr) CA.aab #5
AbemaTV, Inc. All Rights Reserved 2 自己紹介 2023.4 株式会社サイバーエージェント 2023.5
株式会社AbemaTV Native Mobileチーム / Androidエンジニア たなむら (@mtnmr)
AbemaTV, Inc. All Rights Reserved 3 登録不要で、いつでも無料で楽しめる 24時間365日編成されているリニア配信と 見逃した作品を好きなタイミングでオンデマンドでも楽しむこともできます。 国内最大級のオリジナルエピソード数
オリジナルエピソード数は国内発の動画サービスで日本No.1(※)を誇り、 注目の新作映画、国内外の人気ドラマ、話題のアニメなど豊富なラインナップの作品や、 様々な音楽や舞台のオンラインライブも展開。 ※2024年8月時点、自社調べ 100%プロコンテンツ サイバーエージェントとテレビ朝日 それぞれの強みを活かした制作体制で高品質なコンテンツを配信しています。 多彩なラインナップ 24時間編成のニュース専門チャンネルをはじめ、 オリジナルのドラマや恋愛番組、アニメ、スポーツなど、 多彩なジャンルの約25チャンネルを24時間365日放送しています。 ABEMA 紹介
AbemaTV, Inc. All Rights Reserved 4 ABEMA Androidモバイルアプリのプレイヤー コンテンツの種別ごとに別のプレイヤーとして実装されている ホーム
スロット用プレイヤー エピソード用プレイヤー ライブイベント用プレイヤー
AbemaTV, Inc. All Rights Reserved 5 プレイヤー実装の現状 • UI/UiLogicの仕様は同じでも実装が複数ある •
ABEMAモバイルチームではKMPを採用しており共通化を進めているが 初期からある画面なのでKMP導入はされておらず、 Android/iOSでそれぞれロジックを持っている
AbemaTV, Inc. All Rights Reserved 6 再生処理 専門チームからライブラリが提供されており 再生品質はプロダクトと切り離して保証されている Android
プロダクト iOS プロダクト Android プレイヤー ライブラリ iOS プレイヤー ライブラリ プロダクト 開発チーム プレイヤー 開発チーム I/FはPF・コンテンツ共通
AbemaTV, Inc. All Rights Reserved ②アプリ内のプレイヤー実装は 1つにする 7 プレイヤー実装の現状 •
UI/UiLogicの仕様は同じでも実装が複数ある • ABEMAモバイルチームではKMPを採用しており共通化を進めているが 初期からある画面なのでKMP導入はされておらず、 Android/iOSでそれぞれロジックを持っている プレイヤーライブラリの変更に合わせて再実装する ①KMPでAndroid/iOSで ロジックを共通化する
AbemaTV, Inc. All Rights Reserved ②アプリ内のプレイヤー実装は 1つにする 8 プレイヤー実装の現状 ①KMPでAndroid/iOSで
ロジックを共通化する この2つを達成できる設計を考える🤔
AbemaTV, Inc. All Rights Reserved 9 全体 PlayerA PlayerB PlayerC
Player Fragment<T>, ViewModel<T> PlayerUse Case<T> Player UseCaseA Player UseCaseB Player UseCaseC KMP Player Service
AbemaTV, Inc. All Rights Reserved 10 UseCase UIからのイベントは共通だが 内部ロジックが違うため •
呼び出すI/Fは共通 • 実装クラスは インスタンス生成時に Genericsで指定 • コンテンツによらない 共通処理は切り出す PlayerUse Case<T> Player UseCaseA Player UseCaseB Player UseCaseC KMP Player Service interface 実装クラスは コンテンツ種別ごと
AbemaTV, Inc. All Rights Reserved 11 UseCase UIからのイベントは共通だが 内部ロジックが違うため •
呼び出すI/Fは共通 • 実装クラスは インスタンス生成時に Genericsで指定 • コンテンツによらない 共通処理は切り出す interfaceは1つ 実装クラスは複数ある
AbemaTV, Inc. All Rights Reserved 12 UI/UiLogic • 共通で使うFragment, ViewModel
を作る Genericsを指定できるようにする • UseCaseの注入には型情報が必要 PlayerA PlayerB PlayerC Player Fragment<T>, ViewModel<T> PlayerUse Case<T> abstract class
AbemaTV, Inc. All Rights Reserved 13 UI/UiLogic ViewModelはabstractにして それ以下はテンプレート
AbemaTV, Inc. All Rights Reserved 14 UI/UiLogic ViewModelはabstractにして それ以下はテンプレート PlayerContentの型ごとに
Fragmentを定義する ViewModelをオーバーライドする(それ以外は空)
AbemaTV, Inc. All Rights Reserved 15 UI/UiLogic ViewModelはabstractにして それ以下はテンプレート PlayerContentの型ごとに
Fragmentを定義する ViewModelをオーバーライドする(それ以外は空) 呼び出し
AbemaTV, Inc. All Rights Reserved まとめ 16 • 複数あるプレイヤー画面を、KMPとGenericsを使って共通化している ◦
現在も実施中⚒ • 共通化して作り直すことで ◦ PF間の差分がなくなり仕様・UI構造の差分がなくなる ◦ 変更容易性・開発効率が上がる ことを期待している
AbemaTV, Inc. All Rights Reserved