Qt 之QMediaPlayer类详解

QMediaPlayer类是Qt用于播放多媒体流的组件,提供包括MediaStatus枚举、音频和视频状态属性、播放控制功能等。它允许监测音频、缓冲、错误、媒体信息、播放速度、音量等变化,并支持静音、播放位置设定等功能。
摘要由CSDN通过智能技术生成

这是一个播放多媒体流的类

几个重要的枚举类型

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
评论 9
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值