Commit a17fdc0a authored by Remy Sharp's avatar Remy Sharp
Browse files

Tap to play

parent d78de584
......@@ -102,10 +102,21 @@ fileInput.onchange = function () {
previewVideo(file);
}
function play(event) {
if (event.preventDefault) {
event.preventDefault(); // don't trigger the click event
}
// my kindom for a toggle function...
video[video.paused ? 'play' : 'pause']();
}
function previewVideo(file) {
var videoURL = URL.createObjectURL(file);
var video = document.getElementById('video-preview');
console.log(video);
on(videoPreview, 'click', play);
on(videoPreview, 'touchstart', play);
video.src = videoURL;
video.style.width = '100%'
video.poster = '';
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment