Skip to content

Commit 1035432

Browse files
authored
Merge pull request #38 from juanmcampos/patch-1
Fixes loop and finished event not working
2 parents 89a7a9b + 9c2addc commit 1035432

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

videoplayer.ios.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,9 @@ export class Video extends common.Video {
8989

9090
private AVPlayerItemDidPlayToEndTimeNotification(notification: any) {
9191
var notificationString = notification.toString();
92+
var source = this.src.replace("~","");
9293
// Check if src exists in notification, notification is structured liek so: NSConcreteNotification 0x61000024f690 {name = AVPlayerItemDidPlayToEndTimeNotification; object = <AVPlayerItem: 0x600000204190, asset = <AVURLAsset: 0x60000022b7a0, URL = https://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4>>}
93-
if (notificationString.includes(this.src)) {
94+
if (notificationString.includes(source)) {
9495
this._emit(common.Video.finishedEvent);
9596
if (this.loop === true && this._player !== null) {
9697
// Go in 5ms for more seamless looping
@@ -139,4 +140,4 @@ export class Video extends common.Video {
139140
this._playerController = null;
140141
}
141142

142-
}
143+
}

0 commit comments

Comments
 (0)