On Wed, Oct 31, 2012 at 4:44 PM, Gregg Tavares (社用) <gman@google.com> wrote:
Is that more developer friendly? It means if you want to show the same frame between videos you have to do extra work.I'm a little unclear on what you're referring to here. I assume you mean "show the last frame from a previous video in a playlist while a the next video is loading?" I can see how that may be a nice side effect, but it also feels a bit hacky. If I want my video player to nicely transition from one video to the next I have all the events at my disposal to monitor that and do the Right Thing.
var cue = 0;var playlist = ["video1.mp4","video2.mp4","video3.mp4","video4.mp4",];
video.addEventListener('ended', cueNextVideo);function cueNextVideo() {if (cue >= playlist.length) {return;}video.src = "">video.play();}function render() {gl.texImage2D(...., video);gl.drawXXX(...);requestAnimationFrame(render);}cueNextVideo();render();
Not that burdensome either. I feel strongly that texSubImage2D should be a no-op if nothing is available. For texImage2D it seems like it should be a no-op or a 0x0 texture. Not 1x1. My preference is no-op but I don't feel that strongly.
var cue = 0;var playlist = ["video1.mp4","video2.mp4","video3.mp4","video4.mp4",];var update = false;video.addEventListener('ended', cueNextVideo);video.addEventListener('playing', function() {update = true;});function cueNextVideo() {if (cue >= playlist.length) {return;}update = false;video.src = "">video.play();}function render() {if (update) {gl.texImage2D(...., video);}gl.drawXXX(...);requestAnimationFrame(render);}
cueNextVideo();render();