Force stop event on dispose

This commit is contained in:
Thomas Zarebczan 2022-01-28 16:07:57 -05:00 committed by Thomas Zarebczan
parent 1d8105a84a
commit b3d9fe5473

View file

@ -143,6 +143,9 @@ class RecsysPlugin extends Component {
} }
onDispose(event) { onDispose(event) {
// Some browsers don't send onEnded event when closing player/browser, force it here
const recsysEvent = newRecsysPlayerEvent(PlayerEvent.event.stop, this.player.currentTime());
RecSys.onRecsysPlayerEvent(this.options_.videoId, recsysEvent);
RecSys.onPlayerDispose(this.options_.videoId, this.options_.embedded); RecSys.onPlayerDispose(this.options_.videoId, this.options_.embedded);
} }