[HLS Streaming - SWIFT 播放器]HALPlugIn-DeviceGetCurrentTime 问题

问题描述 投票:0回答:1

我目前正在开发 HLS 播放器。在使用 Xcode 在模拟器上测试它时,我注意到它播放音频但不显示视频。

下面是代码片段

import UIKit
import AVKit

class ViewController: UIViewController {

    let playerViewController = AVPlayerViewController()

    override func viewDidLoad() {
        super.viewDidLoad()
        // Do any additional setup after loading the view.
    }

    @IBAction func playVideo(_ sender: AnyObject) {
        guard let url = URL(string: "https://demo.unified-streaming.com/k8s/features/stable/video/tears-of-steel/tears-of-steel.ism/.m3u8") else {
            return
        }
        // Create an AVPlayer, passing it the HTTP Live Streaming URL.
        let player = AVPlayer(url: url)
        print("created player")
        
        // Create a new AVPlayerViewController and pass it a reference to the player.
        let controller = AVPlayerViewController()
        controller.player = player
        
        // Modally present the player and call the player's play() method when complete.
        present(controller, animated: true) {
            print("user started video")
            player.play()
        }
    }
}

错误追踪

HALPlugIn.cpp:551    HALPlugIn::DeviceGetCurrentTime: got an error from the plug-in routine, Error: 1937010544 (stop)

我想要流畅的播放体验。

swift http-live-streaming
1个回答
0
投票

更新 xcode 版本后问题得到解决。谢谢

© www.soinside.com 2019 - 2024. All rights reserved.