How to reduce the loading time between videos

1

I'm doing a project in which you have to randomly load several videos and audios and then play back, this does it well and everything, the problem is the moment of load between video. When you finish playing a video this shows the white background of the page, which is not acceptable, the idea is to try to remove that space that is formed between the load of video A and video B

More or less this is what you see:

This is the space that you notice when you change

Well, more or less that's how you see that. The way in which I load the playlist is through ajax that brings it to me from a php function, that list stores it in another one in javascript and as it plays and ends it increases a position in the vector and thus I get the new route . The idea is to try not to show that, here the js code that I use.

This way I get the playlist:

function getVideo() {
    $.getJSON("http://localhost:500/proyecto/admin/video/getListVideoRep", function (vjson) {
    video = vjson;
   });
}

This is how I manage to reproduce the videos:

function playVideo(id) {
   var long = video.video;
   if (id >= long.length) {
      getVideo();
   }
   else {        
      $('#index-video').attr('src', video.video[id].R);
      rep_video.play();
      continuarVideo(id);
   }
 }

This is the function that allows me to continue with the reproduction:

function continuarVideo(id) {
    rep_video.onended = function () {
       playVideo(parseInt(id) + 1);
    }
}

Someone could advise me on how to solve this.

    
asked by Jhonny Luis 08.05.2018 в 00:53
source

0 answers