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){
return;
}
setFadingEnabled(true);
fragment.setFadingEnabled(true);
// setFadingEnabled(true);
// fragment.setFadingEnabled(true);
if(mTransportControls != null){
mTransportControls.play();
} else {
@ -250,8 +250,8 @@ public class PlaybackHelper extends PlaybackControlGlue {
@Override
protected void pausePlayback() {
setFadingEnabled(false);
fragment.setFadingEnabled(false);
// setFadingEnabled(false);
// fragment.setFadingEnabled(false);
if(mTransportControls != null){
mTransportControls.pause();
} else {

View file

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