这是一个播放多媒体流的类
几个重要的枚举类型
enum QMediaPlayer::MediaStatus
Defines the status of a media player's current media.
| Constant | Value | Description |
|---|---|---|
| QMediaPlayer::UnknownMediaStatus | 0 | The status of the media cannot be determined. |
| QMediaPlayer::NoMedia | 1 | The is no current media. The player is in the StoppedState. |
| QMediaPlayer::LoadingMedia | 2 | The current media is being loaded. The player may be in any state. |
| QMediaPlayer::LoadedMedia | 3 | The current media has been loaded. The player is in the StoppedState. |
| QMediaPlayer::StalledMedia | 4 | Playback of the current media has stalled due to insufficient buffering or some other temporary interruption. The player is in thePlayingState or PausedState. |
| QMediaPlayer::BufferingMedia | 5 | The player is buffering data but has enough data buffered for playback to continue for the immediate future. The player is in thePlayingState or PausedState. |
| QMediaPlayer::BufferedMedia | 6 | The player has fully buffered the current media. The player is in thePlayingState or PausedState. |
| QMediaPlayer::EndOfMedia | 7 | Playback has reached the end of the current media. The player is in theStoppedState. |
| QMediaPlayer::InvalidMedia | 8 | The current media cannot be played. The player is in the StoppedState. |
Properties:
- audioAvailable : const bool 音频是否有效 notifier信号 void audioAvailableChanged(bool available)
- bufferStatus : const int This property holds the percentage of the temporary buffer filled before playback begins or resumes, from (empty) to (full)
- currentMedi

QMediaPlayer类是Qt用于播放多媒体流的组件,提供包括MediaStatus枚举、音频和视频状态属性、播放控制功能等。它允许监测音频、缓冲、错误、媒体信息、播放速度、音量等变化,并支持静音、播放位置设定等功能。
最低0.47元/天 解锁文章
418

被折叠的 条评论
为什么被折叠?



