Skip to content
This repository has been archived by the owner on Jan 12, 2019. It is now read-only.

Video won't restart after long pause #988

Closed
onigetoc opened this issue Jan 31, 2017 · 8 comments
Closed

Video won't restart after long pause #988

onigetoc opened this issue Jan 31, 2017 · 8 comments

Comments

@onigetoc
Copy link

Streaming live Video won't restart after long pause.

It should depent on witch video streaming is, but most of the time, the video won't restart after long pause.
It may have to reload completly.

Suggestion:
Like some Live TV or Youtube LIVE, there's a little Red DOT before Live text.
https://www.youtube.com/watch?v=zaah_hbUHOg&list=PL8fVUTBmJhHJBH1SO88FYKaQsisgItjpn

May be doing some javascript to change the dot color when playing or pause and when is live or playing in buffer.

.vjs-live-display:before {
  content: "•";
  font-size: 172%;
  padding-right: 5px;
  vertical-align: sub;
  color: red;
}

Demo: http://codesniff.com/jquery/hls-http-live-streaming-video-for-videojs-plugin-for-wordpress-m3u8

Another interesting thing, On Youtube, when you click the live button it reload to Live streaming and not in buffer mode.

@onigetoc
Copy link
Author

onigetoc commented Jan 31, 2017

Pure CSS RED / GREY light Before LIVE text.

   .video-js .vjs-live-display:before {
      content: "•";
      font-size: 172%;
      padding-right: 5px;
      vertical-align: sub;
      color: #ccc;
    }
    .video-js.vjs-playing .vjs-live-display:before {
      color: red;
    }
    .video-js.vjs-paused .vjs-live-display:before, .video-js.vjs-waiting .vjs-live-display:before, .video-js.vjs-seeking .vjs-live-display:before {
      color: #ccc;
    }

But need a javascript solution to restart the video in real time and not in the buffer

@onigetoc
Copy link
Author

onigetoc commented Feb 12, 2017

When you pause a HLS m3u8 video, it won't restart in you click play.
Like Youtube, I though about a way to click the LIVE text to reload the video to real time streaming, It may be implemented in your js.

    // RELOAD VIDEO ON CLICK LIVE BUTTON 
    $(document).on('click', '.vjs-live-display', function () {
      player.src({"type":player.currentType(), "src":player.currentSrc()});
      player.load();
      player.play();
    });

OR javascripts only

    videojs('my_video_1', {}, function(){
      
      var player = this;
    
      var liveHSL = document.getElementsByClassName('vjs-live-display')[0];
      
      liveHSL.addEventListener('click', function(event) {
        event.preventDefault();
        player.src({"type":player.currentType(), "src":player.currentSrc()});
        player.load();
        player.play();
      });
      
    });

@mjneil
Copy link
Contributor

mjneil commented Feb 14, 2017

Resuming live stream after a long pause is being address in #1006 so keep an eye out for when that gets merged in

@onigetoc
Copy link
Author

onigetoc commented Feb 14, 2017

what about the idea to go real time when clicking the LIVE button?
Youtube do it this way: https://www.youtube.com/watch?v=MTBOptDSVhQ
If you click play it will play the video in buffer i guess and if you play LIVE it will reload in real time.

@gesinger
Copy link
Contributor

That is definitely something we will consider, or it can be done via a plugin @onigetoc

As for the behavior we have implemented in the above PR, we try to resume from wherever the viewer paused, but if it has been a long enough time that the paused time fell out of the available window, we seek to the live point and resume from there.

@gesinger
Copy link
Contributor

This should be fixed as of the latest release (v5.3.2). If you are still experiencing an issue, please re-open or file a new issue. Thank you.

@campones
Copy link

campones commented Mar 5, 2017

working fine now on my end, that's great!

@onigetoc
Copy link
Author

onigetoc commented Mar 5, 2017

It's working well.
I did find out that if i seek, the video will restart too. It's look faster than reloading the video.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants