@clappr/core
Advanced tools
Comparing version 0.4.14 to 0.4.15
{ | ||
"name": "@clappr/core", | ||
"version": "0.4.14", | ||
"version": "0.4.15", | ||
"description": "Core components of the extensible media player for the web", | ||
@@ -5,0 +5,0 @@ "main": "./dist/clappr-core.js", |
@@ -176,2 +176,3 @@ // Copyright 2014 Globo.com Player authors. All rights reserved. | ||
this.listenTo(this.playback, Events.PLAYBACK_MEDIACONTROL_ENABLE, this.enableMediaControl) | ||
this.listenTo(this.playback, Events.PLAYBACK_SEEK, this.onSeek) | ||
this.listenTo(this.playback, Events.PLAYBACK_SEEKED, this.onSeeked) | ||
@@ -376,6 +377,9 @@ this.listenTo(this.playback, Events.PLAYBACK_ENDED, this.onEnded) | ||
seek(time) { | ||
this.trigger(Events.CONTAINER_SEEK, time, this.name) | ||
this.playback.seek(time) | ||
} | ||
onSeek(time) { | ||
this.trigger(Events.CONTAINER_SEEK, time, this.name) | ||
} | ||
onSeeked() { | ||
@@ -382,0 +386,0 @@ this.trigger(Events.CONTAINER_SEEKED, this.name) |
@@ -77,2 +77,17 @@ import Container from './container' | ||
test('listens to playback:seek event', (done) => { | ||
let playback = new HTML5Playback({ src: '/base/test/fixtures/SampleVideo_360x240_1mb.mp4' }) | ||
let container = new Container({ playback: playback }) | ||
let callback = jest.fn() | ||
container.bindEvents() | ||
container.on(Events.CONTAINER_SEEK, callback) | ||
container.on(Events.CONTAINER_SEEK, () => { | ||
expect(callback).toHaveBeenCalled() | ||
done() | ||
}) | ||
playback.el.dispatchEvent(new Event('seeking')) | ||
}) | ||
test('listens to playback:seeked event', (done) => { | ||
@@ -79,0 +94,0 @@ let playback = new HTML5Playback({ src: '/base/test/fixtures/SampleVideo_360x240_1mb.mp4' }) |
@@ -428,4 +428,4 @@ // Copyright 2014 Globo.com Player authors. All rights reserved. | ||
_onSeeking() { | ||
this.trigger(Events.PLAYBACK_SEEK, this.getCurrentTime()) | ||
this._handleBufferingEvents() | ||
this.trigger(Events.PLAYBACK_SEEK) | ||
} | ||
@@ -432,0 +432,0 @@ |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
1875808
25493
1