Skip to content

Commit 51e77a6

Browse files
author
Matthew Shotton
committed
added catching of the demo exception about pause being called too quickly
1 parent 1a63390 commit 51e77a6

File tree

3 files changed

+12
-8
lines changed

3 files changed

+12
-8
lines changed

dist/videocontext.js

+5-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/videocontext.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/videocontext.js

+6-4
Original file line numberDiff line numberDiff line change
@@ -355,11 +355,13 @@ export default class VideoContext{
355355
//Mark the elements in the video element cache as being able to be controlled programattically.
356356
if (this._videoElementCache){
357357
for (var i = 0; i < this._videoElementCache.length; i++) {
358-
let videoElement = this._videoElementCache[i]
358+
let videoElement = this._videoElementCache[i];
359359
videoElement.play().then(()=>{
360-
videoElement.pause();
361-
}, (err)=>{
362-
videoElement.pause();
360+
try {
361+
videoElement.pause();
362+
} catch(e) {
363+
//catch the inevitable DOM exception.
364+
}
363365
});
364366
}
365367
}

0 commit comments

Comments
 (0)