wang-bin / mdk-sdk

multimedia development kit. download:
https://sourceforge.net/projects/mdk-sdk/files/
289 stars 32 forks source link

建议写一个positionChanged的信号 #193

Closed kaido1412 closed 7 months ago

kaido1412 commented 7 months ago

在播放器播放时发送positionChanged信号,然后可以连接信号到槽函数实现根据视频进度更新滑块

thyagarajarahul1 commented 7 months ago

I did this using a timer and it works.

kaido1412 commented 7 months ago

Me too.

kaido1412 commented 7 months ago

Why is the duration of mediaInfo 0 when it is played for the first time, and it is normal to replay it?

wang-bin commented 7 months ago

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