Closed kaido1412 closed 7 months ago
I did this using a timer and it works.
Me too.
Why is the duration of mediaInfo 0 when it is played for the first time, and it is normal to replay it?
Use a timer and call Player.position()
in your app.
set(State::Playing)
is async, call mediaInfo()
immediately may result in an invalid MediaInfo because video is not loaded. You can listen MediaStatus
changes or use prepare()
with a callback, and get duration when media is loaded or prepared. See https://github.com/wang-bin/mdk-examples/blob/master/Native/MediaInfoReader.cpp#L18
在播放器播放时发送positionChanged信号,然后可以连接信号到槽函数实现根据视频进度更新滑块