播放一个影音文件

js 代码
 
onClick="onClickToPlay('surq%3B..dwnevlurusd%60l%2Fcebiho%60%2Fbnl.89110.551447.4.e16000411001101110%5E%7B%2Fvlw%3Eunjdo%3C8D2C9E65G60B68D350%409BE21%405E0E07012%408093094B43001G9E00CG84B%40CBD886C36E0D58BD1D414%40022B55E4C264B294C758E8DCD29C15C160G48%40236G372GC45E9EE531BB338C4B3B72DEG12DB5E%27bnoudouHoedy%3C0%27bnoudouHe%3C0352137', '我和僵尸有个约会1[1]', ',我和僵尸有个约会1[1]', '1', '1243026', '1')"  
js 代码
function onClickToPlay(playurl, playName, contentFAName, mtype, contentId, contentIndex) { if(typeof(playurl)=="undefined") playurl="" if(typeof(playName)=="undefined") playName="" if(typeof(contentFAName)=="undefined") contentFAName="" if(typeof(mtype)=="undefined") mtype="" if(typeof(contentId)=="undefined") contentId="" if(typeof(contentIndex)=="undefined") contentIndex="0" playerurl += "?playurl=" + playurl; playerurl += "&playName=" + playName; playerurl += "&contentFAName=" + contentFAName; playerurl += "&mtype=" + mtype; playerurl += "&contentId=" + contentId; playerurl += "&contentIndex=" + contentIndex; self.name="WinPlayer"; self.resizeTo("600","400"); var winPlayer=window.open( playerurl,'_self','scrollbars=no,resizable=yes,width=600,height=400',true); // var winPlayer=window.open( playerurl,'WinPlayer','scrollbars=no,resizable=yes,width=600,height=400',true); winPlayer.name = 'WinPlayer'; // window.close(); }
js 代码
//播放一个影音文件 function openPlay(url){ if(url==''){ return; } var popUpSizeX=844; var popUpSizeY=541; var popUpLocationX=Math.round((screen.width-popUpSizeX)/2); var popUpLocationY=Math.round((screen.height-popUpSizeY)/2); if (popUpLocationX<0) popUpLocationX=0; if (popUpLocationY<0) popUpLocationY=0; var splashWin = window.open(url,'MovieDetail','width='+popUpSizeX+',height='+popUpSizeY+',top='+popUpLocationX+',left='+popUpLocationY+',toolbar=0,location=0,directories=0,status=1,menubar=0,scrollbars=1,resizable=1'); splashWin.focus(); } >影音
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
以下是一个简单的 Qt 影音播放程序的示例代码,它使用了 Qt 的 `QMediaPlayer` 类来实现音视频播放功能: ```cpp #include <QApplication> #include <QMediaPlayer> #include <QVideoWidget> #include <QHBoxLayout> #include <QPushButton> int main(int argc, char *argv[]) { QApplication app(argc, argv); // 创建一个媒体播放器对象和一个视频控件对象 QMediaPlayer *player = new QMediaPlayer; QVideoWidget *videoWidget = new QVideoWidget; // 设置视频控件为播放器的输出设备 player->setVideoOutput(videoWidget); // 创建一个水平布局,并添加视频控件和一个播放/暂停按钮 QHBoxLayout *layout = new QHBoxLayout; layout->addWidget(videoWidget); QPushButton *playButton = new QPushButton("Play/Pause"); layout->addWidget(playButton); // 在按钮上注册点击事件,用于控制播放器的播放/暂停状态 QObject::connect(playButton, &QPushButton::clicked, player, &QMediaPlayer::play); QObject::connect(playButton, &QPushButton::clicked, player, &QMediaPlayer::pause); // 加载视频文件,并开始播放 player->setMedia(QUrl::fromLocalFile("video.mp4")); player->play(); // 创建一个主窗口,将布局设置为主窗口的中心部件 QWidget window; window.setLayout(layout); window.show(); return app.exec(); } ``` 在上面的代码中,我们首先创建了一个 `QMediaPlayer` 对象和一个 `QVideoWidget` 对象,然后将视频控件设置为播放器的输出设备。接着,我们创建了一个水平布局,并将视频控件和一个播放/暂停按钮添加到布局中。在按钮上注册点击事件,用于控制播放器的播放/暂停状态。最后,我们将视频文件加载到播放器中,并开始播放。将布局设置为主窗口的中心部件,并显示主窗口。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值