Merge pull request #63 from ChrisMorrisOrg/chrismorris-adhoc
Double-click video to enter fullscreen
This commit is contained in:
@@ -37,6 +37,7 @@ function Player (state, dispatch) {
|
|||||||
onmousemove=${() => dispatch('videoMouseMoved')}>
|
onmousemove=${() => dispatch('videoMouseMoved')}>
|
||||||
<video
|
<video
|
||||||
src='${state.server.localURL}'
|
src='${state.server.localURL}'
|
||||||
|
ondblclick=${() => dispatch('toggleFullScreen')}
|
||||||
onloadedmetadata=${onLoadedMetadata}
|
onloadedmetadata=${onLoadedMetadata}
|
||||||
autoplay>
|
autoplay>
|
||||||
</video>
|
</video>
|
||||||
@@ -116,6 +117,7 @@ function renderPlayerControls (state, dispatch) {
|
|||||||
|
|
||||||
// Handles a click or drag to scrub (jump to another position in the video)
|
// Handles a click or drag to scrub (jump to another position in the video)
|
||||||
function handleScrub (e) {
|
function handleScrub (e) {
|
||||||
|
dispatch('videoMouseMoved')
|
||||||
var windowWidth = document.querySelector('body').clientWidth
|
var windowWidth = document.querySelector('body').clientWidth
|
||||||
var fraction = e.clientX / windowWidth
|
var fraction = e.clientX / windowWidth
|
||||||
var position = fraction * state.video.duration /* seconds */
|
var position = fraction * state.video.duration /* seconds */
|
||||||
|
|||||||
Reference in New Issue
Block a user