question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

handle buffer between two videos (for slow connections)

See original GitHub issue

Description

When video 1 is loading buffer video 2 has to be paused until video 1 is ready to continue, then both videos must be played.

Expected Behavior

Pause and play video handling buffer.

Actual Behavior

When video 1 is loading buffer, video 2 pauses, but no video starts again when buffer is ready.

Steps to Reproduce

    "@angular/animations": "^4.0.0",
    "@angular/common": "^4.0.0",
    "@angular/compiler": "^4.0.0",
    "@angular/core": "^4.0.0",
    "@angular/forms": "^4.0.0",
    "@angular/http": "^4.0.0",
    "@angular/platform-browser": "^4.0.0",
    "@angular/platform-browser-dynamic": "^4.0.0",
    "@angular/router": "^4.0.0",
    "@types/core-js": "^0.9.42",
    "core-js": "^2.4.1",
    "rxjs": "^5.4.1",
    "videogular2": "^5.4.11",
    "zone.js": "^0.8.14"
@angular/cli: 1.2.7
node: 8.2.1
os: win32 x64

.HTML

<vg-player (onPlayerReady)="onPlayerReady($event)">
    <vg-overlay-play></vg-overlay-play>
    <vg-buffering></vg-buffering>
    <vg-controls>
        <vg-play-pause></vg-play-pause>
        <vg-playback-button></vg-playback-button>
        <vg-time-display vgProperty="current" vgFormat="mm:ss"></vg-time-display>
        <vg-scrub-bar [vgSlider]="true">
            <vg-scrub-bar-current-time [vgSlider]="true"></vg-scrub-bar-current-time>
            <vg-scrub-bar-buffering-time></vg-scrub-bar-buffering-time>
        </vg-scrub-bar>
        <vg-time-display vgProperty="left" vgFormat="mm:ss"></vg-time-display>
        <vg-time-display vgProperty="total" vgFormat="mm:ss"></vg-time-display>
        <vg-mute></vg-mute>
        <vg-volume></vg-volume>
        <vg-fullscreen></vg-fullscreen>
    </vg-controls>
    <video
        #primary
        [vgMedia]="primary"
        [vgMaster]="true"
        id="firstVideo"
        preload="auto">
        <source src="http://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4" type="video/mp4" >
    </video>
    <video 
        #secondary 
        [vgMedia]="secondary" 
        id="secondVideo" 
        preload="auto" 
        crossorigin>
        <source src="http://static.videogular.com/assets/videos/videogular.mp4" type="video/mp4">
    </video>   
</vg-player>

.TS

 onPlayerReady(api: VgAPI) {
    this.api = api;
    this.api.getMasterMedia().subscriptions.timeUpdate.subscribe(() => {
      this.firstVideo = this.api.getMediaById('firstVideo');
      this.secondVideo = this.api.getMediaById('secondVideo');
      if (this.firstVideo.isBufferDetected || this.secondVideo.isBufferDetected) {
        if (this.firstVideo.isWaiting || this.secondVideo.isWaiting) {
          this.firstVideo.pause();
          this.secondVideo.pause();
        }
        if (this.firstVideo.canPlayThrough || this.secondVideo.canPlayThrough) {
          this.firstVideo.play();
          this.secondVideo.play();
        }
      }
    });
  }

Issue Analytics

  • State:open
  • Created 6 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
Elecashcommented, Aug 21, 2017

This is a new feature, we can try to add it in the next release.

0reactions
moi12frecommented, Apr 23, 2020

any updates in this release?

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Stop Buffering When Streaming Internet Videos | Avast
Video streaming is on the rise, but buffering problems can easily spoil the experience. We'll show you how to fix the most common...
Read more >
How to Stop Videos from Buffering on Your Phone
If the video is taking forever to start or is always buffering, it means your internet connection speed is not fast enough to...
Read more >
How To Stop Video Buffering Issues - A Quick, Simple Guide
Video buffering is a necessary part of streaming–unless it is holding up your playback. Here is a guide to minimizing buffering issues.
Read more >
Slow connection? Force YouTube to buffer the entire video ...
Someone with a fast connection could easily preload a 10 minute long video while watching the first 30 seconds before deciding not to...
Read more >
What Is Video Buffering and How Can You Stop It? - MCTV
Downloading large files can take up a significant amount of bandwidth, and this can be compounded when you have multiple items downloading at ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found