Compare commits
2 commits
fc5bbabd9d
...
9c9b2b000e
Author | SHA1 | Date | |
---|---|---|---|
9c9b2b000e | |||
f068111110 |
1 changed files with 5 additions and 3 deletions
|
@ -68,11 +68,11 @@ const videos = [
|
||||||
window.addEventListener("load", autoplayInit, false);
|
window.addEventListener("load", autoplayInit, false);
|
||||||
const videos = document.getElementsByClassName("marquee-item-content") as HTMLCollectionOf<HTMLVideoElement>;
|
const videos = document.getElementsByClassName("marquee-item-content") as HTMLCollectionOf<HTMLVideoElement>;
|
||||||
let currentVideoIndex = 0;
|
let currentVideoIndex = 0;
|
||||||
let currentVideo = null;
|
let currentVideo: HTMLVideoElement | null = null;
|
||||||
|
|
||||||
function autoplayInit() {
|
function autoplayInit() {
|
||||||
setActiveVideo(0);
|
setActiveVideo(0);
|
||||||
currentVideo.play();
|
currentVideo!.play();
|
||||||
}
|
}
|
||||||
|
|
||||||
function setActiveVideo(index: number) {
|
function setActiveVideo(index: number) {
|
||||||
|
@ -115,7 +115,9 @@ const videos = [
|
||||||
video.addEventListener("ended", () => {
|
video.addEventListener("ended", () => {
|
||||||
console.log("video ended", "duration", video.duration, "ctime", video.currentTime);
|
console.log("video ended", "duration", video.duration, "ctime", video.currentTime);
|
||||||
// The "ended" event might just mean its buffering.
|
// The "ended" event might just mean its buffering.
|
||||||
if (video == currentVideo && video.duration !== 0 && video.currentTime === video.duration) nextVideo();
|
if (video == currentVideo && video.duration !== 0 && video.currentTime === video.duration) {
|
||||||
|
offsetCarousel(1);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue