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
バッチ処理を「状態の記録」から「事実の記録」へ
panda728
PRO
0
160
品質ワークショップをやってみた
nealle
0
460
登壇は dynamic! な営みである / speech is dynamic
da1chi
0
340
Goで実践するドメイン駆動開発 AIと歩み始めた新規プロダクト開発の現在地
imkaoru
4
850
iOSエンジニア向けの英語学習アプリを作る!
yukawashouhei
0
190
オープンソースソフトウェアへの解像度🔬
utam0k
16
3k
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
180
Six and a half ridiculous things to do with Quarkus
hollycummins
0
180
私はどうやって技術力を上げたのか
yusukebe
44
19k
Swift Concurrency - 状態監視の罠
objectiveaudio
2
530
Leading Effective Engineering Teams in the AI Era
addyosmani
7
450
Go Conference 2025: Goで体感するMultipath TCP ― Go 1.24 時代の MPTCP Listener を理解する
takehaya
9
1.7k
Featured
See All Featured
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
359
30k
The Power of CSS Pseudo Elements
geoffreycrofte
79
6k
A better future with KSS
kneath
239
18k
Build The Right Thing And Hit Your Dates
maggiecrowley
37
2.9k
Java REST API Framework Comparison - PWX 2021
mraible
34
8.9k
Testing 201, or: Great Expectations
jmmastey
45
7.7k
YesSQL, Process and Tooling at Scale
rocio
173
14k
Embracing the Ebb and Flow
colly
88
4.9k
Practical Orchestrator
shlominoach
190
11k
Building a Scalable Design System with Sketch
lauravandoore
463
33k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
33
2.3k
Making the Leap to Tech Lead
cromwellryan
135
9.6k
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