videogular / videogular2

The HTML5 video player for Angular 2
https://videogular.github.io/videogular2-showroom/#/
MIT License
672 stars 211 forks source link

[Bug] Abort error when fast switching audio src attribute #681

Open luchillo17 opened 6 years ago

luchillo17 commented 6 years ago

Description

I have an audio and a custom media side to side, with the custom media being the MasterMedia.

It plays very well in most cases, but there's one where it doesn't, if my user hit's double click on the next button, the app breaks.

About the medias, each custom media has it's own audio, and such audio src changes (in other words, the thing that changes is the src of the tag, no re-renders.

Expected Behavior

To deal ok with the fast switching of the sources for that audio tag.

Actual Behavior

A bug happens, and once it happens it keeps popping, the overlay keeps playing & pausing each second, and no audio is reproduced.

Steps to Reproduce

Dunno how to make an example of this due to the size of project, the most i can tell is:

Attachments

Here are images of how i've setup the audio along with custom component, how it looks the custom component from outside, and the bug in console: image image image

marty331 commented 6 years ago

I have the same issue but with fast switching videos.

luchillo17 commented 6 years ago

I've found my issue, though is hard to manage,Switching is not really the issue, my issue was the auto-play feat, since it subscribes to all medias and wait for it's loadedMetadata subscription, it tried to hit play from the first one when the second audio (after the second switch) wasn't really ready, i had to add logic to cancel such subs when a new event of switch is there.

The issue now is that if the user hit's play while any of them are still loading, it will break with error shown in the screenshot of description, i don't have the control to block user interaction while they are loading, neither a way to tell Videogular2 to wait for them to be ready (should show the buffering spinner).

Another issue is that if the user hit's play while only 1 is loaded, Videogular will start playing such one and when the Master media is ready, it will reset the time of the audio, the lack of docs doesn't help me either in dealing with this.

andrejnsimoes commented 6 years ago

Same here. I tested with this demo: https://github.com/videogular/videogular2-showroom/tree/master/src/app/smart-playlist

luchillo17 commented 6 years ago

Which one? the premature play one? or the one when only 1 media is loaded.