mirror of
https://gitlab.com/futo-org/fcast.git
synced 2025-06-24 21:25:23 +00:00
Receivers: Fixed player event handler attachment leak
This commit is contained in:
parent
7182a1b63d
commit
78143ed172
1 changed files with 7 additions and 7 deletions
|
@ -345,14 +345,14 @@ function onPlay(_event, value: PlayMessage) {
|
||||||
if (isMediaItem && cachedPlayMediaItem.showDuration && cachedPlayMediaItem.showDuration > 0) {
|
if (isMediaItem && cachedPlayMediaItem.showDuration && cachedPlayMediaItem.showDuration > 0) {
|
||||||
showDurationTimeout = window.setTimeout(mediaEndHandler, cachedPlayMediaItem.showDuration * 1000);
|
showDurationTimeout = window.setTimeout(mediaEndHandler, cachedPlayMediaItem.showDuration * 1000);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Sender generated event handlers
|
// Sender generated event handlers
|
||||||
window.targetAPI.onPause(() => { player.pause(); });
|
window.targetAPI.onPause(() => { player?.pause(); });
|
||||||
window.targetAPI.onResume(() => { player.play(); });
|
window.targetAPI.onResume(() => { player?.play(); });
|
||||||
window.targetAPI.onSeek((_event, value: SeekMessage) => { player.setCurrentTime(value.time); });
|
window.targetAPI.onSeek((_event, value: SeekMessage) => { player?.setCurrentTime(value.time); });
|
||||||
window.targetAPI.onSetVolume((_event, value: SetVolumeMessage) => { volumeChangeHandler(value.volume); });
|
window.targetAPI.onSetVolume((_event, value: SetVolumeMessage) => { volumeChangeHandler(value.volume); });
|
||||||
window.targetAPI.onSetSpeed((_event, value: SetSpeedMessage) => { player.setPlaybackRate(value.speed); playerCtrlStateUpdate(PlayerControlEvent.SetPlaybackRate); });
|
window.targetAPI.onSetSpeed((_event, value: SetSpeedMessage) => { player?.setPlaybackRate(value.speed); playerCtrlStateUpdate(PlayerControlEvent.SetPlaybackRate); });
|
||||||
}
|
|
||||||
|
|
||||||
function onPlayPlaylist(_event, value: PlaylistContent) {
|
function onPlayPlaylist(_event, value: PlaylistContent) {
|
||||||
logger.info('Handle play playlist message', JSON.stringify(value));
|
logger.info('Handle play playlist message', JSON.stringify(value));
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue