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

PLAYLIST_COMPLETED not called (tested on iOS only) #22

Open
biesbjerg opened this issue Jan 28, 2019 · 0 comments
Open

PLAYLIST_COMPLETED not called (tested on iOS only) #22

biesbjerg opened this issue Jan 28, 2019 · 0 comments

Comments

@biesbjerg
Copy link

biesbjerg commented Jan 28, 2019

Expected Behaviour

When last item in playlist has completed PLAYLIST_COMPLETED should be called.

Actual Behaviour

It is not called.

Reproduce Scenario (including but not limited to)

Steps to Reproduce

I've only tested this on iOS.

Set playlist using setPlaylistItems, call play and let it play until the end.

Platform and Version (eg. Android 5.0 or iOS 9.2.1)

iPhone X, iOS 12

Cordova CLI version and cordova platform version

8.1.2 ([email protected])

Installed platforms:
android 6.2.3
browser 4.1.0
ios 4.4.0
Available platforms:
osx ~4.0.1
windows ~6.0.0

Plugin version

cordova-plugin-playlist 0.6.0 "AudioPlayer"

Sample Push Data Payload

Sample Code that illustrates the problem

Logs taken while reproducing problem

2019-01-28 12:32:10.382879+0100 Mindly[4001:1605081] playbackDuration ==> 29.97696
2019-01-28 12:32:10.383058+0100 Mindly[4001:1605081] MPNowPlayingInfoPropertyElapsedPlaybackTime ==> 29.98025
2019-01-28 12:32:10.383125+0100 Mindly[4001:1605081] title ==> Sunflower (Spider-Man: Into the Spider-Verse)
2019-01-28 12:32:10.383178+0100 Mindly[4001:1605081] MPNowPlayingInfoPropertyPlaybackRate ==> 1
2019-01-28 12:32:10.383221+0100 Mindly[4001:1605081] albumTitle ==> Spider-Man: Into the Spider-Verse (Soundtrack From & Inspired by the Motion Picture)
2019-01-28 12:32:10.383265+0100 Mindly[4001:1605081] artist ==> Post Malone & Swae Lee
2019-01-28 12:32:10.384862+0100 Mindly[4001:1605081] Queue changed current item to: (null)
2019-01-28 12:32:10.384961+0100 Mindly[4001:1605081] New item ID: (null)
2019-01-28 12:32:10.385009+0100 Mindly[4001:1605081] Queue is at end: YES
2019-01-28 12:32:10.389039+0100 Mindly[4001:1605081] RmxAudioPlayer.onStatus: Playback Completed(50) [1445949267]:  [object Object]
2019-01-28 12:32:10.395449+0100 Mindly[4001:1605081] RmxAudioPlayer.onStatus: Playback Position Changed(40) [1445949267]:  [object Object]
2019-01-28 12:32:10.395551+0100 Mindly[4001:1605081] RmxAudioPlayer.onStatus: Track Changed(100) [NONE]:  [object Object]
2019-01-28 12:32:10.408013+0100 Mindly[4001:1605081] RmxAudioPlayer.onStatus: Stopped(60) [INVALID]:
2019-01-28 12:32:10.408138+0100 Mindly[4001:1605081] ERROR: BAIL STATUS UPDATE, NO DATA 60

It seems the callback never fires because _isReplacingItems is true at runtime. What is the purpose of checking for this variable?

WORKAROUND
As a temporary workaround, instead of using setPlaylistItems you can chain clearAllItems and addAllItems:

return this.wrapPromise('clearAllItems', (resolve, reject) => {
	this.instance.clearAllItems(resolve, reject);
}).then(() => this.wrapPromise('addAllItems', (resolve, reject) => {
	this.instance.addAllItems(resolve, reject, tracks);
}));
@biesbjerg biesbjerg changed the title PLAYLIST_COMPLETE not called on iOS PLAYLIST_COMPLETED not called (tested on iOS only) Jan 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant