Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How To Tell When All Audio Files Are Done Playing? #14

Closed
aw-emberex opened this issue Jan 3, 2014 · 2 comments
Closed

How To Tell When All Audio Files Are Done Playing? #14

aw-emberex opened this issue Jan 3, 2014 · 2 comments

Comments

@aw-emberex
Copy link
Contributor

To the best of my knowledge and of reading the source, there is no event to tell when all audio files in a playlist have completed.

I know the playlist can be updated on the fly, so that this event could be fired multiple times, but I think it could be really useful.

Since there's no way to tell when a single audio file is done, the :pause event is used for both, I've done the following to tell when my playlist is over.

Do you have any suggestions on how I could improve this or the source code itself?

            $scope.$watch("audio1.currentTrack", function(currentTrackNumber) {
                if (!$scope.audio1) return;
                if (currentTrackNumber == $scope.audio1.tracks) {
                    var deregister = $scope.$on("narrationPlayer:pause", function(scope, currentlyPlaying) {
                        if (!currentlyPlaying) {
                            //allPlayedEvent()
                            deregister();
                        }
                    });
                }
            });
@colthreepv
Copy link
Owner

Will be done in next release, there will be a property called ended, it will be set to true then an audio element is completed and there is NOT a next in line

It will appear soon in the next branch

@colthreepv
Copy link
Owner

Closed thanks to ended property in 0.5.0 release

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

No branches or pull requests

2 participants