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
110
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
Startups on Rails in Past, Present and Future–Irina Nazarova, RailsConf 2025
irinanazarova
0
170
The Niche of CDK Grant オブジェクトって何者?/the-niche-of-cdk-what-isgrant-object
hassaku63
1
440
Webの外へ飛び出せ NativePHPが切り拓くPHPの未来
takuyakatsusa
2
570
MDN Web Docs に日本語翻訳でコントリビュートしたくなる
ohmori_yusuke
1
130
The Modern View Layer Rails Deserves: A Vision For 2025 And Beyond @ RailsConf 2025, Philadelphia, PA
marcoroth
2
660
ソフトウェア品質を数字で捉える技術。事業成長を支えるシステム品質の マネジメント
takuya542
2
14k
はじめてのWeb API体験 ー 飲食店検索アプリを作ろうー
akinko_0915
0
120
AIと”コードの評価関数”を共有する / Share the "code evaluation function" with AI
euglena1215
1
170
20250704_教育事業におけるアジャイルなデータ基盤構築
hanon52_
5
900
顧客の画像データをテラバイト単位で配信する 画像サーバを WebP にした際に起こった課題と その対応策 ~継続的な取り組みを添えて~
takutakahashi
1
230
ペアプロ × 生成AI 現場での実践と課題について / generative-ai-in-pair-programming
codmoninc
2
20k
dbt民主化とLLMによる開発ブースト ~ AI Readyな分析サイクルを目指して ~
yoshyum
3
1.1k
Featured
See All Featured
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
29
9.6k
Being A Developer After 40
akosma
90
590k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
44
2.4k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.4k
Product Roadmaps are Hard
iamctodd
PRO
54
11k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
667
120k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
107
19k
Typedesign – Prime Four
hannesfritz
42
2.7k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
15
1.6k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
251
21k
Visualization
eitanlees
146
16k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
35
2.4k
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