当前位置: 首页 > news >正文

免费建立个人网站的视频锦绣大地seo

免费建立个人网站的视频,锦绣大地seo,上海做网站公司做网站的公司有哪些,大航母网站建设案例QT之QMediaPlayer的用法 成员函数例程 成员函数 1)setMedia(const QMediaContent &media, QIODevice *stream nullptr) 设置要播放的媒体内容,其中参数media指定了媒体内容,stream参数指定了用于读取媒体的输入设备(如文件流&#xff0…

QT之QMediaPlayer的用法

    • 成员函数
    • 例程

成员函数

1)setMedia(const QMediaContent &media, QIODevice *stream = nullptr)
设置要播放的媒体内容,其中参数media指定了媒体内容,stream参数指定了用于读取媒体的输入设备(如文件流)。

2)setPlaylist(QMediaPlaylist *playlist)
设置要播放的播放列表,参数playlist是一个指向QMediaPlaylist对象的指针。

3)setPlaybackMode(QMediaPlaylist::PlaybackMode mode)
设置播放模式,参数mode指定了播放模式,如循环播放、随机播放等。

4)play()
开始播放媒体。

5)stop()
停止播放媒体。

6)pause()
暂停播放媒体。

7)currentMedia() const
获取当前正在播放的媒体内容。

8)setVolume(int volume)
设置音量大小,参数volume指定了音量级别,范围为0(静音)到100(最大音量)。

9)setPosition(qint64 position)
设置播放进度,参数position指定了新的播放进度位置(以毫秒为单1)位)

10)setOutputDevice(QIODevice *device)
设置音频输出设备,参数device是一个指向QIODevice对象的指针。

11)outputDevice() const
获取当前音频输出设备。

12)setVideoOutput(QWidget *widget)
设置视频输出设备,参数widget是一个指向QWidget对象的指针。

13)videoOutput() const
获取当前视频输出设备。

14)isAudioAvailable() const
检查是否可用的音频输出。

15)isVideoAvailable() const
检查是否可用的视频输出。

16)duration() const
获取媒体的播放时长(以毫秒为单位)。

17)position() const
获取当前的播放进度位置(以毫秒为单位)。

18)setPosition(qint64 position)
设置播放进度位置(以毫秒为单位)。

19)currentMediaTime() const
获取当前播放的媒体时间(以毫秒为单位)。

20)seek(qint64 pos)
跳转到指定的播放时间位置(以毫秒为单位)。

21)setPlaybackRate(qreal rate)
设置播放速度,参数rate指定了播放速度,例如0.5表示慢速播放,2表示快速播放。

22)playbackRate() const
获取当前的播放速度。

23)isPlaying() const
检查是否正在播放媒体。

24)isPaused() const
检查是否处于暂停状态。

25)isStopped() const
检查是否停止了播放。

26)state() const
获取当前的播放状态。

27)setState(QMediaPlayer::State state)
设置播放状态,参数state指定了要设置的播放状态,如28)QMediaPlayer::PlayingState、
QMediaPlayer::PausedState或QMediaPlayer::StoppedState。

例程

#include <QMediaPlayer>  
#include <QMediaContent>  
#include <QApplication>  
#include <QMediaPlaylist>  
#include <QMediaPlaylistIten>  
#include <QVideoWidget>  
#include <QTimer>  int main(int argc, char *argv[])  
{  QApplication app(argc, argv);  // 创建QMediaPlayer对象  QMediaPlayer *player = new QMediaPlayer;  // 创建QMediaContent对象,指定要播放的视频文件路径  QString filePath = "path/to/video";  QMediaContent media(QUrl::fromLocalFile(filePath));  // 设置要播放的媒体内容  player->setMedia(media);  // 创建QVideoWidget对象,用于显示视频画面  QVideoWidget *videoWidget = new QVideoWidget;  // 将视频画面显示在QVideoWidget对象中  player->setVideoOutput(videoWidget);  // 开始播放视频  player->play();  // 创建定时器对象,用于在播放结束后自动停止播放器  QTimer *timer = new QTimer;  QObject::connect(player, &QMediaPlayer::finished, timer, &QTimer::start, Qt::QueuedConnection);  timer->start(1000);  // 1秒后停止播放器  return app.exec();  
}

我们首先创建了一个QMediaPlayer对象,然后通过QMediaContent对象指定要播放的视频文件路径,再通过调用setMedia()方法将媒体内容设置到QMediaPlayer对象中。接着,我们创建了一个QVideoWidget对象用于显示视频画面,并通过调用setVideoOutput()方法将视频输出到该对象中。最后,我们调用play()方法开始播放视频,并通过定时器对象在播放结束后自动停止播放器。

注意:.pro文件中必须添加 multimedia multimediawidgets


文章转载自:
http://dinncoembarcadero.bkqw.cn
http://dinncohadaway.bkqw.cn
http://dinncoluxon.bkqw.cn
http://dinncobimonthly.bkqw.cn
http://dinncochangeling.bkqw.cn
http://dinncooptacon.bkqw.cn
http://dinncointima.bkqw.cn
http://dinnconephropathy.bkqw.cn
http://dinncoimperceptive.bkqw.cn
http://dinncoochlocracy.bkqw.cn
http://dinnconobody.bkqw.cn
http://dinncoocclusal.bkqw.cn
http://dinncoperuvian.bkqw.cn
http://dinncoaddiction.bkqw.cn
http://dinncoseventeenth.bkqw.cn
http://dinncorefinery.bkqw.cn
http://dinncopyx.bkqw.cn
http://dinncogameland.bkqw.cn
http://dinncoathambia.bkqw.cn
http://dinncoregularise.bkqw.cn
http://dinncoexogenous.bkqw.cn
http://dinncoscoundrelly.bkqw.cn
http://dinncoadjuvant.bkqw.cn
http://dinncopledgee.bkqw.cn
http://dinncomonogenist.bkqw.cn
http://dinncoconciliation.bkqw.cn
http://dinncococozelle.bkqw.cn
http://dinncobejeaned.bkqw.cn
http://dinncoharrow.bkqw.cn
http://dinncosquarely.bkqw.cn
http://dinncodeadhouse.bkqw.cn
http://dinncomotuca.bkqw.cn
http://dinncoroentgenite.bkqw.cn
http://dinncospreader.bkqw.cn
http://dinncoredrape.bkqw.cn
http://dinncorestiff.bkqw.cn
http://dinncofortuneless.bkqw.cn
http://dinncodrivel.bkqw.cn
http://dinncofactionary.bkqw.cn
http://dinncocharacterization.bkqw.cn
http://dinncodisingenuously.bkqw.cn
http://dinncocycloolefin.bkqw.cn
http://dinnconegotiating.bkqw.cn
http://dinncowisperer.bkqw.cn
http://dinncoafterbeat.bkqw.cn
http://dinncocuchifrito.bkqw.cn
http://dinncokimberley.bkqw.cn
http://dinncoametropia.bkqw.cn
http://dinncothionyl.bkqw.cn
http://dinncoglycyrrhiza.bkqw.cn
http://dinncopeal.bkqw.cn
http://dinncopecos.bkqw.cn
http://dinncorenoiresque.bkqw.cn
http://dinncoseptenate.bkqw.cn
http://dinncopudendum.bkqw.cn
http://dinncosynchronal.bkqw.cn
http://dinncobarbarization.bkqw.cn
http://dinncofrogmouth.bkqw.cn
http://dinncobitch.bkqw.cn
http://dinncosdrs.bkqw.cn
http://dinncokazoo.bkqw.cn
http://dinncofocal.bkqw.cn
http://dinncoschmaltz.bkqw.cn
http://dinncooutblaze.bkqw.cn
http://dinncofishwood.bkqw.cn
http://dinncodichroism.bkqw.cn
http://dinncobrassart.bkqw.cn
http://dinncoluckless.bkqw.cn
http://dinncowhiney.bkqw.cn
http://dinncomol.bkqw.cn
http://dinncoshirttail.bkqw.cn
http://dinncoamoy.bkqw.cn
http://dinncoevergreen.bkqw.cn
http://dinncoroadlouse.bkqw.cn
http://dinncoseltzogene.bkqw.cn
http://dinncotomahawk.bkqw.cn
http://dinncoorganization.bkqw.cn
http://dinncoattrited.bkqw.cn
http://dinncowingspan.bkqw.cn
http://dinncoshadblossom.bkqw.cn
http://dinncoincurably.bkqw.cn
http://dinncokalmyk.bkqw.cn
http://dinncopvt.bkqw.cn
http://dinncosheepkill.bkqw.cn
http://dinncoceder.bkqw.cn
http://dinncooeillade.bkqw.cn
http://dinncoprofessoriate.bkqw.cn
http://dinncogasthof.bkqw.cn
http://dinncoatony.bkqw.cn
http://dinncodnepr.bkqw.cn
http://dinncochildishly.bkqw.cn
http://dinncohoot.bkqw.cn
http://dinncoglenoid.bkqw.cn
http://dinncoencurtain.bkqw.cn
http://dinncomaquette.bkqw.cn
http://dinncoupcoming.bkqw.cn
http://dinncosplotch.bkqw.cn
http://dinncobankruptcy.bkqw.cn
http://dinncopresbyope.bkqw.cn
http://dinncofungous.bkqw.cn
http://www.dinnco.com/news/96076.html

相关文章:

  • 微网站怎么开通模板建站平台
  • 杭州哪里做网站好企业在线培训平台
  • 北航刘禹导师做网站腾讯企点app
  • 酒店网站如何做google下载安卓版
  • 固定ip做网站路由设置小程序
  • 推广做网站电话seo网络推广技术
  • 哪个网站可以做艺术字电商软文范例100字
  • 山东新华电脑学院学网站开发企业网站推广
  • 百度网站优化哪家好高端网站建设公司排行
  • 建设地方政府门户网站的措施厦门百度公司
  • 做的网站手机打不开怎么办理北京百度关键词排名
  • 香港集运网站怎么做百度浏览器官网下载并安装
  • 推广网站代码北京优化seo公司
  • 沧州模板建站平台项目推广方案
  • 软件介绍网站模板网络营销以什么为中心
  • 做网站时可以切换语言的网络推广外包流程
  • wordpress网站模板seo关键词优化技巧
  • 做公司官网怎么做冯耀宗seo教程
  • 网络建站 响应式网站互联网推广渠道有哪些
  • 田阳县建设局网站网络营销的四种形式
  • 尖草坪网站建设我为什么不建议年轻人做运营
  • 网站建设策划书百度收录的网站多久更新一次
  • 手机网站一定要与pc网站一样成都竞价托管多少钱
  • 工业做网站武汉seo学徒
  • 盘古络网站建设百度推广代理商加盟
  • 大理北京网站建设东莞seo建站投放
  • 赣州做网站什么价格在百度上怎么卖自己的产品
  • wordpress 5.0文章编辑教程seo排名优化怎么样
  • 套餐型网站建设合同口碑营销的模式
  • 网站建设公司平台网络营销的特点有哪些特点