Merge pull request #100 from liamgray/master

Fix looping video
This commit is contained in:
Feross Aboukhadijeh
2016-03-08 17:53:59 -08:00

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) {