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
120
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.8k
Other Decks in Programming
See All in Programming
フロントエンドのmonorepo化と責務分離のリアーキテクト
kajitack
2
140
あなたとJIT, 今すぐアセンブ ル
sisshiki1969
1
730
Claude Codeで挑むOSSコントリビュート
eycjur
0
180
マイコンでもRustのtestがしたい その2/KernelVM Tokyo 18
tnishinaga
2
2.3k
Microsoft Orleans, Daprのアクターモデルを使い効率的に開発、デプロイを行うためのSekibanの試行錯誤 / Sekiban: Exploring Efficient Development and Deployment with Microsoft Orleans and Dapr Actor Models
tomohisa
0
210
UbieのAIパートナーを支えるコンテキストエンジニアリング実践
syucream
2
740
AIエージェント開発、DevOps and LLMOps
ymd65536
1
350
あのころの iPod を どうにか再生させたい
orumin
2
2.5k
私の後悔をAWS DMSで解決した話
hiramax
4
150
コーディングは技術者(エンジニア)の嗜みでして / Learning the System Development Mindset from Rock Lady
mackey0225
2
590
20250808_AIAgent勉強会_ClaudeCodeデータ分析の実運用〜競馬を題材に回収率100%の先を目指すメソッドとは〜
kkakeru
0
210
ライブ配信サービスの インフラのジレンマ -マルチクラウドに至ったワケ-
mirrativ
2
270
Featured
See All Featured
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
110
20k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
34
3.1k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
9
780
Embracing the Ebb and Flow
colly
87
4.8k
Connecting the Dots Between Site Speed, User Experience & Your Business [WebExpo 2025]
tammyeverts
8
480
Code Review Best Practice
trishagee
70
19k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
48
9.6k
4 Signs Your Business is Dying
shpigford
184
22k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
50
5.5k
Optimising Largest Contentful Paint
csswizardry
37
3.4k
Documentation Writing (for coders)
carmenintech
73
5k
Fashionably flexible responsive web design (full day workshop)
malarkey
407
66k
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