Skip to content

Commit 96b6075

Browse files
committed
fix(media): remove callback ref & clean up
1 parent 29702cd commit 96b6075

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

packages/canvas-media/video/index.ios.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -322,15 +322,9 @@ export class Video extends VideoBase {
322322
this._assetOutput = AVPlayerItemVideoOutput.alloc().initWithOutputSettings(settings);
323323
item.addOutput(this._assetOutput);
324324
item.addObserverForKeyPathOptionsContext(this.#protocols, 'status', 0, null);
325-
this._ctx = new interop.Reference(0);
326-
item.addObserverForKeyPathOptionsContext(this.#protocols, 'loadedTimeRanges', NSKeyValueObservingOptions.Initial | NSKeyValueObservingOptions.New, this._ctx);
325+
item.addObserverForKeyPathOptionsContext(this.#protocols, 'loadedTimeRanges', NSKeyValueObservingOptions.Initial | NSKeyValueObservingOptions.New, null);
327326
this._playEndNotificationId = NSNotificationCenter.defaultCenter.addObserverForNameObjectQueueUsingBlock(AVPlayerItemDidPlayToEndTimeNotification, item, null, (notfi) => {
328327
if (this.loop) {
329-
if (this._assetReader && this._assetReader.status === AVAssetReaderStatus.Reading) {
330-
this._assetReader.cancelReading();
331-
this._assetReader = undefined;
332-
this._assetOutput = undefined;
333-
}
334328
this.#player.seekToTime(kCMTimeZero);
335329
this.#player.play();
336330
this._isPlaying = true;

0 commit comments

Comments
 (0)