-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MediaSession 을 이용한 Media Control Player UI #274
Conversation
@@ -0,0 +1,42 @@ | |||
package com.ohdodok.catchytape.feature.player |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이 파일에서 개행이 모두 2줄로 되어있는데 어떤 특별한 의도가 없다면 개행을 1줄로 하는 것 어떤가요?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
반영했습니다~
|
||
fun ExoPlayer.moveNextMedia() { | ||
seekToNextMediaItem() | ||
if (isPlaying) { | ||
play() | ||
} | ||
} | ||
|
||
|
||
fun ExoPlayer.movePreviousMedia() { | ||
seekToPreviousMediaItem() | ||
if (isPlaying) { | ||
play() | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
반복되는 함수 추출한 것 좋은 것 같습니당 👍🏻
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
고생하셨습니당~
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
고생했어용~!
Issue
Overview
Player에 대한 기능에서, MainActivity와 PlayerFragment 공통으로 사용하는 로직을 PlayerUtil.kt 파일에 확장함수로 작성하였습니다.
MediaMetadata 을 설정해야, Media Control에 제대로 배경과, title 정보가 나타나게 됩니다.
Screenshot
스크린샷은 Android api 33에서 찍었습니다.