autoplay video

This commit is contained in:
Felix 2017-04-04 02:14:13 +02:00
parent 91cb464553
commit e7a597f702
2 changed files with 7 additions and 5 deletions

View file

@ -239,8 +239,8 @@ public class PlaybackHelper extends PlaybackControlGlue {
if(getCurrentSpeedId() == speed){ if(getCurrentSpeedId() == speed){
return; return;
} }
setFadingEnabled(true); // setFadingEnabled(true);
fragment.setFadingEnabled(true); // fragment.setFadingEnabled(true);
if(mTransportControls != null){ if(mTransportControls != null){
mTransportControls.play(); mTransportControls.play();
} else { } else {
@ -250,8 +250,8 @@ public class PlaybackHelper extends PlaybackControlGlue {
@Override @Override
protected void pausePlayback() { protected void pausePlayback() {
setFadingEnabled(false); // setFadingEnabled(false);
fragment.setFadingEnabled(false); // fragment.setFadingEnabled(false);
if(mTransportControls != null){ if(mTransportControls != null){
mTransportControls.pause(); mTransportControls.pause();
} else { } else {

View file

@ -126,7 +126,6 @@ public class OverlayFragment extends PlaybackFragment{
setBackgroundType(PlaybackFragment.BG_LIGHT); setBackgroundType(PlaybackFragment.BG_LIGHT);
setFadingEnabled(false); setFadingEnabled(false);
mHelper.setFadingEnabled(true);
} }
@Override @Override
@ -158,6 +157,7 @@ public class OverlayFragment extends PlaybackFragment{
Log.d(TAG,"Callback not set or not event/stream"); Log.d(TAG,"Callback not set or not event/stream");
} }
requestAudioFocus(); requestAudioFocus();
play();
} }
private Row getRelatedItems() { private Row getRelatedItems() {
@ -298,11 +298,13 @@ public class OverlayFragment extends PlaybackFragment{
private void play() { private void play() {
setPlaybackState(PlaybackState.STATE_PLAYING); setPlaybackState(PlaybackState.STATE_PLAYING);
setFadingEnabled(true);
mCallback.play(); mCallback.play();
} }
private void pause() { private void pause() {
setPlaybackState(PlaybackState.STATE_PAUSED); setPlaybackState(PlaybackState.STATE_PAUSED);
setFadingEnabled(false);
mCallback.pause(); mCallback.pause();
} }