Commit 661fee01 authored by Geoffrey Métais's avatar Geoffrey Métais

Show notification while casting

parent 7d8cfdad
......@@ -497,10 +497,13 @@ public class PlaybackService extends MediaBrowserServiceCompat{
mHandler.sendEmptyMessage(SHOW_PROGRESS);
changeAudioFocus(true);
if (!mWakeLock.isHeld()) mWakeLock.acquire();
if (!mKeyguardManager.inKeyguardRestrictedInputMode() && !playlistManager.getVideoBackground() && playlistManager.switchToVideo()) {
if (!mKeyguardManager.inKeyguardRestrictedInputMode()
&& !playlistManager.getVideoBackground()
&& !hasRenderer()
&& playlistManager.switchToVideo()) {
hideNotification();
} else {
showPlayer();
if (!hasRenderer()) showPlayer();
showNotification();
}
break;
......
......@@ -292,8 +292,9 @@ class PlaylistManager(val service: PlaybackService) : MediaWrapperList.EventList
val media = getCurrentMedia()
if (media === null || media.hasFlag(MediaWrapper.MEDIA_FORCE_AUDIO) || !player.canSwitchToVideo())
return false
val hasRenderer = RendererDelegate.selectedRenderer !== null
videoBackground = false
if (player.isVideoPlaying()) {//Player is already running, just send it an intent
if (player.isVideoPlaying() && !hasRenderer) {//Player is already running, just send it an intent
player.setVideoTrackEnabled(true)
LocalBroadcastManager.getInstance(service).sendBroadcast(
VideoPlayerActivity.getIntent(Constants.PLAY_FROM_SERVICE,
......@@ -301,7 +302,7 @@ class PlaylistManager(val service: PlaybackService) : MediaWrapperList.EventList
} else if (!player.switchToVideo) {//Start the video player
VideoPlayerActivity.startOpened(VLCApplication.getAppContext(),
media.uri, currentIndex)
player.switchToVideo = true
if (!hasRenderer) player.switchToVideo = true
}
return true
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment