diff --git a/PlayWallPlugins/PlayWallPluginContentPlayer/src/main/scala/de/tobias/playpad/plugin/content/pad/ContentPlayerPadContent.scala b/PlayWallPlugins/PlayWallPluginContentPlayer/src/main/scala/de/tobias/playpad/plugin/content/pad/ContentPlayerPadContent.scala index 76089ee8711fdb1b2b438f38d014a9614695719b..39d2762cfcd92e594b8bb7a1a4997223be464fee 100644 --- a/PlayWallPlugins/PlayWallPluginContentPlayer/src/main/scala/de/tobias/playpad/plugin/content/pad/ContentPlayerPadContent.scala +++ b/PlayWallPlugins/PlayWallPluginContentPlayer/src/main/scala/de/tobias/playpad/plugin/content/pad/ContentPlayerPadContent.scala @@ -64,6 +64,7 @@ class ContentPlayerPadContent(val pad: Pad, val `type`: String) extends PadConte } showingLastFrame = false isPause = false + stopMediaByOtherPlayer = false } override def pause(): Unit = { @@ -80,7 +81,7 @@ class ContentPlayerPadContent(val pad: Pad, val `type`: String) extends PadConte if (getCurrentPlayingMediaIndex != -1) { mediaPlayers(getCurrentPlayingMediaIndex).stop() - if (showingLastFrame) { + if (showingLastFrame && !stopMediaByOtherPlayer) { ContentPluginMain.playerViewController.clearHold(mediaPlayers(getCurrentPlayingMediaIndex)) } } @@ -96,7 +97,6 @@ class ContentPlayerPadContent(val pad: Pad, val `type`: String) extends PadConte // 3. There is no playlist if (!pad.getPadSettings.isLoop && getCurrentPlayingMediaIndex + 1 == mediaPlayers.length) { if (!shouldShowLastFrame()) { - Logger.debug(s"Clear last frame for pad ${pad.getPadIndex}") ContentPluginMain.playerViewController.clearHold(mediaPlayers(getCurrentPlayingMediaIndex)) } else { showingLastFrame = true diff --git a/PlayWallPlugins/PlayWallPluginContentPlayer/src/main/scala/de/tobias/playpad/plugin/content/player/ContentPlayerBinding.scala b/PlayWallPlugins/PlayWallPluginContentPlayer/src/main/scala/de/tobias/playpad/plugin/content/player/ContentPlayerBinding.scala index 6b1b9c61448edfe4f5ff0be1973e205879f3b655..99b2e6063345ba76b83105a17a7ec2f6db64d459 100644 --- a/PlayWallPlugins/PlayWallPluginContentPlayer/src/main/scala/de/tobias/playpad/plugin/content/player/ContentPlayerBinding.scala +++ b/PlayWallPlugins/PlayWallPluginContentPlayer/src/main/scala/de/tobias/playpad/plugin/content/player/ContentPlayerBinding.scala @@ -65,9 +65,7 @@ class ContentPlayerBinding(val player: ContentPlayer, val zone: Zone) { def stop(media: ContentPlayerMediaContainer): Unit = { // If media is stopped by a different pad, the current media should keep playing to have a smooth transition // to the new media. Otherwise the media will be stopped normally. - if (media.content.stopMediaByOtherPlayer) { - media.content.stopMediaByOtherPlayer = false - } else { + if (!media.content.stopMediaByOtherPlayer) { player.Stop() } } diff --git a/PlayWallPlugins/PlayWallPluginContentPlayer/src/main/scala/de/tobias/playpad/plugin/content/player/ContentPlayerWindowController.scala b/PlayWallPlugins/PlayWallPluginContentPlayer/src/main/scala/de/tobias/playpad/plugin/content/player/ContentPlayerWindowController.scala index 8172f52830fb4baaa838261ab8270f03f23561fd..2c333a5aa0153ca6ef31e17d4b50cc1b36a89116 100644 --- a/PlayWallPlugins/PlayWallPluginContentPlayer/src/main/scala/de/tobias/playpad/plugin/content/player/ContentPlayerWindowController.scala +++ b/PlayWallPlugins/PlayWallPluginContentPlayer/src/main/scala/de/tobias/playpad/plugin/content/player/ContentPlayerWindowController.scala @@ -1,8 +1,9 @@ package de.tobias.playpad.plugin.content.player +import de.thecodelabs.logger.Logger import de.tobias.playpad.PlayPadPlugin import de.tobias.playpad.plugin.content.pad.ContentPlayerMediaContainer -import de.tobias.playpad.plugin.content.settings.{Zone, ContentPlayerPluginConfiguration, ContentPlayerSettingsViewController} +import de.tobias.playpad.plugin.content.settings.{ContentPlayerPluginConfiguration, ContentPlayerSettingsViewController, Zone} import nativecontentplayerwindows.{ContentPlayer, ContentPlayerWindow} import scala.collection.mutable.ListBuffer @@ -75,6 +76,7 @@ class ContentPlayerWindowController { } def clearHold(media: ContentPlayerMediaContainer): Unit = { + Logger.debug(s"Clear last frame for pad ${media.content.pad.getPadIndex}") getContentPlayerBindings(media.content.getSelectedZones).foreach(player => player.clearHold()) }