From a131a4595dce6be8fa9f21a425fbaf7893c5e0fb Mon Sep 17 00:00:00 2001 From: ThibaultBee <37510686+ThibaultBee@users.noreply.github.com> Date: Thu, 25 Jul 2024 16:41:18 +0200 Subject: [PATCH] test --- Examples/iOS/PlayerViewController.swift | 2 +- .../IntegrationTests/AVPlayerExtensionsTests.swift | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Examples/iOS/PlayerViewController.swift b/Examples/iOS/PlayerViewController.swift index 7c125488..83f0b0dc 100644 --- a/Examples/iOS/PlayerViewController.swift +++ b/Examples/iOS/PlayerViewController.swift @@ -5,7 +5,7 @@ import UIKit class PlayerViewController: UIViewController { let playerView: ApiVideoPlayerView = .init( frame: .zero, - videoOptions: VideoOptions(videoId: "vi77Dgk0F8eLwaFOtC5870yn", videoType: .vod) + videoOptions: VideoOptions(videoId: "vi1pVSrHJVabmE44TfNp0my9", videoType: .vod) ) let scrollView: UIScrollView = { diff --git a/Tests/ApiVideoPlayerTests/IntegrationTests/AVPlayerExtensionsTests.swift b/Tests/ApiVideoPlayerTests/IntegrationTests/AVPlayerExtensionsTests.swift index ff70514e..d1247ffe 100644 --- a/Tests/ApiVideoPlayerTests/IntegrationTests/AVPlayerExtensionsTests.swift +++ b/Tests/ApiVideoPlayerTests/IntegrationTests/AVPlayerExtensionsTests.swift @@ -10,12 +10,13 @@ final class AVPlayerExtensions: XCTestCase { _ = observer.readyExpectation let avPlayer = AVPlayer(playerItem: nil) + avPlayer.addObserver(observer, forKeyPath: "status", options: .new, context: nil) avPlayer.replaceCurrentItem(withHls: VideoOptions(videoId: VideoId.validVideoId, videoType: .vod)) - avPlayer.currentItem?.addObserver(observer, forKeyPath: "status", options: .new, context: nil) + avPlayer.play() waitForExpectations(timeout: 10, handler: nil) - avPlayer.currentItem?.removeObserver(observer, forKeyPath: "status") + avPlayer.removeObserver(observer, forKeyPath: "status") } func testValidMP4VideoIdPlay() throws {