3 ms·
There are situations when you need to play video on load. (for example, you want a nicely designed content or DIVs.) But Maybe a browser option to enable/disabl
by thomasdd 10y ago
There are situations when you need to play video on load. (for example, you want a nicely designed content or DIVs.) But Maybe a browser option to enable/disable video playback would solve this. Maybe disabling audio would be as an option, so as webdesigner you can show the relevant visual content but without sound.
- lucaspiller 10y ago> There are situations when you need to play video on load No there really aren't, not on page load [0]. Show a nice still with a big play button on it - people know what that means. It's probably going to load faster too, so people won't be stuck staring at a blank section for 15 seconds. Or even worse, start reading and scrolling the first two paragraphs, then wonder why some audio started playing. And as others have said, you may be costing the user money - there is no way to tell if they have to pay for their data usage, so be kind and minimise how much data you need. [0] I may be able to excuse you if you are building a streaming video service, and want the next episode to play automatically.
- pdkl95 10y ago> [0] That could be handled by allowing the media tag to be changed and restarted with a new URL during (and only during) the "ended" event[1]. That would allow continuing an already playing video with minimal side effects. E.g. only alow something like this: var video = document.getElementsById("current_video_tag"); var play_next_video = function () { video.src = "https://exmple.com/next_video_url"; video.currentTime = 0; video.play(); }); /* this should work */ video.addEventListener("ended", play_next_video); /* but these shouldn't */ video.addEventListener("progress", play_next_video); setTimeout(play_next_video, 1000); [1] https://developer.mozilla.org/en-US/docs/Web/Guide/Events/Media_events https://developer.mozilla.org/en-US/docs/Web/Guide/Events/Me...
- kuschku 10y agoAnd what if you want to support changing the video through remote control? Say, allow the user to open the site on their phone and TV, and the phone shows play/pause/next buttons, the TV shows the episode, and the phone can be used to skip to the next episode? (Data synced because the user is logged in on both, via a standard webbrowser)?