parent
5b5f48f9f3
commit
4bf541932a
2 changed files with 11 additions and 3 deletions
|
@ -103,7 +103,8 @@
|
||||||
android:configChanges="orientation|screenSize" />
|
android:configChanges="orientation|screenSize" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".ViewMediaActivity"
|
android:name=".ViewMediaActivity"
|
||||||
android:theme="@style/TuskyBaseTheme" />
|
android:theme="@style/TuskyBaseTheme"
|
||||||
|
android:configChanges="orientation|screenSize|keyboardHidden|screenLayout|smallestScreenSize" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".components.account.AccountActivity"
|
android:name=".components.account.AccountActivity"
|
||||||
android:configChanges="orientation|screenSize|keyboardHidden|screenLayout|smallestScreenSize" />
|
android:configChanges="orientation|screenSize|keyboardHidden|screenLayout|smallestScreenSize" />
|
||||||
|
|
|
@ -12,6 +12,7 @@ class ExposedPlayPauseVideoView @JvmOverloads constructor(
|
||||||
VideoView(context, attrs, defStyleAttr) {
|
VideoView(context, attrs, defStyleAttr) {
|
||||||
|
|
||||||
private var listener: PlayPauseListener? = null
|
private var listener: PlayPauseListener? = null
|
||||||
|
private var playing = false
|
||||||
|
|
||||||
fun setPlayPauseListener(listener: PlayPauseListener) {
|
fun setPlayPauseListener(listener: PlayPauseListener) {
|
||||||
this.listener = listener
|
this.listener = listener
|
||||||
|
@ -19,12 +20,18 @@ class ExposedPlayPauseVideoView @JvmOverloads constructor(
|
||||||
|
|
||||||
override fun start() {
|
override fun start() {
|
||||||
super.start()
|
super.start()
|
||||||
listener?.onPlay()
|
if (!playing) {
|
||||||
|
playing = true
|
||||||
|
listener?.onPlay()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun pause() {
|
override fun pause() {
|
||||||
super.pause()
|
super.pause()
|
||||||
listener?.onPause()
|
if (playing) {
|
||||||
|
playing = false
|
||||||
|
listener?.onPause()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
interface PlayPauseListener {
|
interface PlayPauseListener {
|
||||||
|
|
Loading…
Reference in a new issue