automatically size player on start

This commit is contained in:
Feross Aboukhadijeh
2016-03-03 01:05:00 -08:00
parent 128cb679aa
commit 4d094c8209
5 changed files with 117 additions and 39 deletions

View File

@@ -7,15 +7,18 @@ function Player (state, dispatch) {
h('video', {
src: state.server.localURL,
autoplay: true,
controls: true
}),
h('a.close', {
onclick: closePlayer
}, 'Close')
controls: true,
onplaying: onPlaying
})
])
function closePlayer () {
dispatch('closePlayer')
function onPlaying (e) {
var video = e.target
var dimensions = {
width: video.videoWidth,
height: video.videoHeight
}
dispatch('setDimensions', dimensions)
}
}