Fix looping video

This commit is contained in:
Liam Gray
2016-03-08 17:36:20 -08:00
parent 64048171bc
commit 9324765db9

View File

@@ -35,6 +35,7 @@ function Player (state, dispatch) {
src='${state.server.localURL}'
ondblclick=${() => dispatch('toggleFullScreen')}
onloadedmetadata=${onLoadedMetadata}
onended=${onEnded}
autoplay>
</video>
</div>
@@ -51,6 +52,11 @@ function Player (state, dispatch) {
}
dispatch('setDimensions', dimensions)
}
// When the video completes, pause the video instead of looping
function onEnded (e) {
state.video.isPaused = true
}
}
function renderPlayerControls (state, dispatch) {