A
A
Andrey2016-01-29 17:52:53
JavaScript
Andrey, 2016-01-29 17:52:53

How to clone a video element without reloading the video?

Good afternoon.
There is a video element on the page that needs to be cloned after the video is loaded so that the resulting element has the same video without reloading and so that they do not depend on each other. Like this:

Video.prototype.initVideo = function() {
    this.videoObject = document.createElement('video');
    this.videoObject.src = this.videoUrl;
    
    // On video loaded
    this.videoObject.addEventListener('loadedmetadata', function () {
        this.cachingVideoObject = some_cloning_function(this.videoObject);
        this.cachingVideoObject.currentTime = 10;
        // this.cachingVideoObject.currentTime != this.videoObject.currentTime
    }, false);
};

Are there options?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question