Skip to content
This repository has been archived by the owner on Jan 24, 2023. It is now read-only.

Fix/bb 2137 rename event listener #36

Merged
merged 4 commits into from
Apr 25, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions cypress/static/ui.html
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,14 @@
video.addEventListener('contentVideoEnded', function() {
console.log('contentVideoEnded')
})
video.addEventListener('contentVideoFirstQuartile', function() {
console.log('contentVideoFirstQuartile')
video.addEventListener('contentVideoSecondOctile', function() {
console.log('contentVideoSecondOctile')
})
video.addEventListener('contentVideoMidpoint', function() {
console.log('contentVideoMidpoint')
})
video.addEventListener('contentVideoThirdQuartile', function() {
console.log('contentVideoThirdQuartile')
video.addEventListener('contentVideoSixthOctile', function() {
console.log('contentVideoSixthOctile')
})
StroeerVideoplayer.setDefaultUIName('default')
const myvideoplayer = new StroeerVideoplayer(video);
Expand Down
8 changes: 4 additions & 4 deletions dev/dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,16 +47,16 @@ video.addEventListener('contentVideoEnded', function () {
console.log('contentVideoEnded')
})

video.addEventListener('contentVideoFirstQuartile', function () {
console.log('contentVideoFirstQuartile')
video.addEventListener('contentVideoSecondOctile', function () {
console.log('contentVideoSecondOctile')
})

video.addEventListener('contentVideoMidpoint', function () {
console.log('contentVideoMidpoint')
})

video.addEventListener('contentVideoThirdQuartile', function () {
console.log('contentVideoThirdQuartile')
video.addEventListener('contentVideoSixthOctile', function () {
console.log('contentVideoSixthOctile')
})

video.addEventListener('plugin-endcard:show', function () {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "0.13.1",
"version": "0.14.0",
"name": "@stroeer/stroeer-videoplayer-plugin-endcard",
"description": "Ströer Videoplayer Endcard Plugin",
"main": "dist/stroeerVideoplayer-endcard-plugin.umd.js",
Expand Down
4 changes: 2 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,15 @@ const plugin = {
const videoEl = stroeervideoplayer.getVideoEl()
endcardPlugin = new EndcardPlugin(stroeervideoplayer, opts)

videoEl.addEventListener('contentVideoFirstQuartile', onVideoElFirstQuartile)
videoEl.addEventListener('contentVideoSecondOctile', onVideoElFirstQuartile)
videoEl.addEventListener('contentVideoEnded', onVideoElEnd)
},
deinit: (stroeervideoplayer: IStroeerVideoplayer) => {
const videoEl = stroeervideoplayer.getVideoEl()
const endcardContainer = stroeervideoplayer.getRootEl().querySelector('.plugin-endcard-container')

if (endcardContainer !== undefined) {
videoEl.removeEventListener('contentVideoFirstQuartile', onVideoElFirstQuartile)
videoEl.removeEventListener('contentVideoSecondOctile', onVideoElFirstQuartile)
videoEl.removeEventListener('contentVideoEnded', onVideoElEnd)
endcardPlugin.reset()
endcardContainer.remove()
Expand Down
Loading