(video, cm)
| 592 | }; |
| 593 | |
| 594 | function 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 | |
| 618 | window.addEventListener("load", function() { |
| 619 | bind(); |
no test coverage detected