簡體   English   中英

如何在 VLCKit 中觀察更精確的播放器時間?

[英]How to observe more precise player time in VLCKit?

我正在嘗試將MobileVLCKit合並到我的應用程序中,但默認時間觀察器對我來說不夠精確,並且會使進度條在時間之間跳轉。 有沒有辦法獲得更精確的時間更新(例如,每 1/60 秒)?

這是我當前的代碼:

let player = VLCMediaPlayer()

func mediaPlayerTimeChanged(_ aNotification: Notification) {
    print(player.time)
}

/// 0.0
/// 0.0
/// 0.0
/// 0.1
/// 0.1
/// 0.1
/// 0.2

提前致謝!

嘗試: player.position

例如:

let player = VLCMediaPlayer()

func mediaPlayerTimeChanged(_ aNotification: Notification) {
    print(player.position)
}

您還需要獲取內容長度才能將其轉換為人類可讀的時間,例如: let content_length = player.media.length

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM