I have looked at the code and tried to fix it, but it is far to involved for me and I end up getting stuck. It may be best put off until after 2.4.
The key reason for this behaviour is:
openlp/core/ui/media/mediacontroller.py:174:
Creates a dict of media players from the backends. Each back-end is instantiated The dict looks like this:
{'vlc': <openlp.core.ui.media.vlcplayer.VlcPlayer object at 0x7f4410913f28>,
'phonon': <openlp.core.ui.media.phononplayer.PhononPlayer object at 0x7f4410913ef0>,
'webkit': <openlp.core.ui.media.webkitplayer.WebkitPlayer object at 0x7f4410913eb8>}
openlp/core/ui/media/mediacontroller.py:532 & openlp/core/ui/media/mediacontroller.py:537:
Adds the instace of the media player with a key (1 for preview & 0 for live)
After starting OpenLP and sending a video to preview, the dict looks like this:
{1: <openlp.core.ui.media.webkitplayer.WebkitPlayer object at 0x7fef5572ae10>}
Then after sending the video to live, the dict looks like this (notice that the live and preview players are the same object):
{0: <openlp.core.ui.media.webkitplayer.WebkitPlayer object at 0x7fef5572ae10>,
1: <openlp.core.ui.media.webkitplayer.WebkitPlayer object at 0x7fef5572ae10>}
So in the case of webkit when the pause button is clicked (openlp.core.ui.media.webkitplayer.WebkitPlayer#pause), the code :
display.frame.evaluateJavaScript('show_video("pause");')
is excuted, because this is based on display (which is a different object for preview and live) the video in the correct controller is affected.
However when the state of the player is updated with:
self.state = self.state = MediaState.Paused
both players states are updated (because they are the same object).
I have looked at the code and tried to fix it, but it is far to involved for me and I end up getting stuck. It may be best put off until after 2.4.
The key reason for this behaviour is:
openlp/ core/ui/ media/mediacont roller. py:174: core.ui. media.vlcplayer .VlcPlayer object at 0x7f4410913f28>, core.ui. media.phononpla yer.PhononPlaye r object at 0x7f4410913ef0>, core.ui. media.webkitpla yer.WebkitPlaye r object at 0x7f4410913eb8>}
Creates a dict of media players from the backends. Each back-end is instantiated The dict looks like this:
{'vlc': <openlp.
'phonon': <openlp.
'webkit': <openlp.
openlp/ core/ui/ media/mediacont roller. py:532 & openlp/ core/ui/ media/mediacont roller. py:537:
Adds the instace of the media player with a key (1 for preview & 0 for live)
After starting OpenLP and sending a video to preview, the dict looks like this: core.ui. media.webkitpla yer.WebkitPlaye r object at 0x7fef5572ae10>}
{1: <openlp.
Then after sending the video to live, the dict looks like this (notice that the live and preview players are the same object): core.ui. media.webkitpla yer.WebkitPlaye r object at 0x7fef5572ae10>, core.ui. media.webkitpla yer.WebkitPlaye r object at 0x7fef5572ae10>}
{0: <openlp.
1: <openlp.
So in the case of webkit when the pause button is clicked (openlp. core.ui. media.webkitpla yer.WebkitPlaye r#pause) , the code : frame.evaluateJ avaScript( 'show_video( "pause" );')
display.
is excuted, because this is based on display (which is a different object for preview and live) the video in the correct controller is affected.
However when the state of the player is updated with:
self.state = self.state = MediaState.Paused
both players states are updated (because they are the same object).