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.7k
Other Decks in Programming
See All in Programming
データの民主化を支える、透明性のあるデータ利活用への挑戦 2025-06-25 Database Engineering Meetup#7
y_ken
0
340
PostgreSQLのRow Level SecurityをPHPのORMで扱う Eloquent vs Doctrine #phpcon #track2
77web
2
440
LINEヤフー データグループ紹介
lycorp_recruit_jp
0
1.7k
Hypervel - A Coroutine Framework for Laravel Artisans
albertcht
1
110
PHPで始める振る舞い駆動開発(Behaviour-Driven Development)
ohmori_yusuke
2
240
関数型まつりレポート for JuliaTokai #22
antimon2
0
160
PHPでWebSocketサーバーを実装しよう2025
kubotak
0
250
GitHub Copilot and GitHub Codespaces Hands-on
ymd65536
1
140
Blazing Fast UI Development with Compose Hot Reload (droidcon New York 2025)
zsmb
1
280
すべてのコンテキストを、 ユーザー価値に変える
applism118
2
1.1k
AWS CDKの推しポイント 〜CloudFormationと比較してみた〜
akihisaikeda
3
320
新メンバーも今日から大活躍!SREが支えるスケールし続ける組織のオンボーディング
honmarkhunt
1
480
Featured
See All Featured
Imperfection Machines: The Place of Print at Facebook
scottboms
267
13k
Building Flexible Design Systems
yeseniaperezcruz
328
39k
Six Lessons from altMBA
skipperchong
28
3.9k
Build your cross-platform service in a week with App Engine
jlugia
231
18k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
331
22k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
657
60k
GraphQLとの向き合い方2022年版
quramy
49
14k
Side Projects
sachag
455
42k
Fashionably flexible responsive web design (full day workshop)
malarkey
407
66k
Reflections from 52 weeks, 52 projects
jeffersonlam
351
20k
GraphQLの誤解/rethinking-graphql
sonatard
71
11k
jQuery: Nuts, Bolts and Bling
dougneiner
63
7.8k
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