Hi Norbert,

Personally I think one of the best approaches to solving this would be to
preload all the videos in separate video elements in the background and
capture them all with mozCaptureStream(). (It's captureStream() by spec but
we're not spec compliant yet. For playing the capture in another media
element it should be fine though.)

Then you have a separate video element that is displayed that plays a `new
MediaStream(tracks)` with tracks from the background element you want to
show. When you want to swap video you swap the tracks in this MediaStream.
There might be minor glitches but I think this minimises them as well as we
can.

Perhaps something could be done with MSE as well, but it's really not my
area, and I'd be a bit concerned with latency since you are feeding a
buffer.


Andreas

On Sun, Oct 1, 2017 at 7:21 PM, popot.org <[email protected]> wrote:

> Hi all, I have a question.
> Hopefully, this is a suitable mailing list to ask it.
>
> I use a full-width <video> on a page, and I use some simple JavaScript
> (jQuery) to change its src and trigger the .play() method each time the
> video ends.
>
> The page is:
> https://www.popot.org/chomper_dance.php
>
> About ~10 seconds the second video loads. (This happens when the
> in-video character first reaches the right of the metal jaws.)
>
> A new video also loads when the website visitor presses the "Oops"
> button under the video. (This button enables after ~10 seconds.)
>
> The problem I'm encountering: each time a new video starts (loads), the
> transition is too noticable.
>
> My question is, in the JavaScript (at the end of the page source), is
> there an easy way to pre-load videos that will be used in the src _in
> the future_?
>
> Looking forward to hear your feedback.
>
> Best regards,
> Norbert
> _______________________________________________
> dev-media mailing list
> [email protected]
> https://lists.mozilla.org/listinfo/dev-media
>
_______________________________________________
dev-media mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-media

Reply via email to