Skip to content
Snippets Groups Projects
Commit 1606265b authored by Tobias Ullerich's avatar Tobias Ullerich
Browse files

#173 - Do not clear hold on media end when new media is played

parent bbf2bc30
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
......@@ -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()
}
}
......
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())
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment