Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
asurdej-comcast committed Jul 21, 2023
1 parent c4603ad commit be1a47f
Showing 1 changed file with 18 additions and 5 deletions.
23 changes: 18 additions & 5 deletions tests/html5_video_early_ended_test.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,17 @@
#logs{
position: absolute;
left: 50%;
width: 50%;
width: 25%;
background-color: cyan;
font-size: small;
}

#logsTime{
position: absolute;
left: 75%;
width: 25%;
background-color: cyan;
font-size: x-small;
font-size: xx-small;
}

</style>
Expand All @@ -34,8 +42,8 @@
<div id="videoContainer">
<video id="html5Video" controls></video>
</div>
<div id="logs">
</div>
<div id="logs"></div>
<div id="logsTime"></div>
<div id="container"></div>

<script>
Expand All @@ -48,12 +56,17 @@
var html5Video = document.getElementById("html5Video");
var videoContainer = document.getElementById("videoContainer");
var logDiv = document.getElementById("logs");
var logDivT = document.getElementById("logsTime");
logDiv.innerHTML = "Logs:";

function log(msg) {
console.log(msg);
logDiv.innerHTML += "<br>" + msg;
}
function logTime(msg) {
console.log(msg);
logDivT.innerHTML += "<br>" + msg;
}

html5Video.addEventListener('ended', function () {
log('Video ended. video element current time: ' + html5Video.currentTime);
Expand All @@ -70,7 +83,7 @@
});

html5Video.addEventListener('timeupdate', function () {
log('Video timeupdate. video element current time: '+ html5Video.currentTime);
logTime('Video timeupdate. video element current time: '+ html5Video.currentTime);
});

html5Video.src = advertUrls.shift();
Expand Down

0 comments on commit be1a47f

Please sign in to comment.