MCPcopy
hub / github.com/jabbany/CommentCoreLibrary / bindVideo

Function bindVideo

demo/debugger.js:594–616  ·  view source on GitHub ↗
(video, cm)

Source from the content-addressed store, hash-verified

592};
593
594function bindVideo(video, cm) {
595 video.addEventListener("timeupdate", function() {
596 if (cm.display === false) return;
597 if (video.hasStalled) {
598 cm.start();
599 video.hasStalled = false;
600 }
601 cm.time(Math.floor(video.currentTime * 1000));
602 displayTime(Math.floor(video.currentTime * 1000));
603 });
604 video.addEventListener("play", function() {
605 cm.start();
606 });
607 video.addEventListener("pause", function() {
608 cm.stop();
609 });
610 video.addEventListener("waiting", function() {
611 cm.stop();
612 });
613 video.addEventListener("playing", function() {
614 cm.start();
615 });
616};
617
618window.addEventListener("load", function() {
619 bind();

Callers 1

bindTestsFunction · 0.85

Calls 4

addEventListenerMethod · 0.65
startMethod · 0.65
timeMethod · 0.65
stopMethod · 0.65

Tested by

no test coverage detected