本文整理汇总了C++中Video::loadStreamUrl方法的典型用法代码示例。如果您正苦于以下问题:C++ Video::loadStreamUrl方法的具体用法?C++ Video::loadStreamUrl怎么用?C++ Video::loadStreamUrl使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Video
的用法示例。
在下文中一共展示了Video::loadStreamUrl方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: reloadCurrentVideo
void MediaView::reloadCurrentVideo() {
Video *video = playlistModel->activeVideo();
if (!video) return;
int oldFormat = video->getDefinitionCode();
QObject *context = new QObject();
connect(video, &Video::gotStreamUrl, context,
[this, oldFormat, video, context](const QString &videoUrl, const QString &audioUrl) {
context->deleteLater();
if (oldFormat == video->getDefinitionCode()) return;
QObject *context2 = new QObject();
const qint64 position = media->position();
connect(media, &Media::stateChanged, context2,
[position, this, context2](Media::State state) {
if (state == Media::PlayingState) {
media->seek(position);
context2->deleteLater();
Video *video = playlistModel->activeVideo();
QString msg = tr("Switched to %1")
.arg(VideoDefinition::forCode(
video->getDefinitionCode())
.getName());
MainWindow::instance()->showMessage(msg);
}
});
if (audioUrl.isEmpty()) {
media->play(videoUrl);
} else {
media->playSeparateAudioAndVideo(videoUrl, audioUrl);
}
});
video->loadStreamUrl();
}
示例2: retriveRealUrl
void VideoDetailsModel::retriveRealUrl()
{
Video *video = new Video;
QUrl videoUrl(m_videoUrl);
video->setWebpage(videoUrl);
video->loadStreamUrl();
connect(video, SIGNAL(gotStreamUrl(QUrl)), this, SLOT(streamUrl(QUrl)));
}
示例3: activeRowChanged
void MediaView::activeRowChanged(int row) {
if (stopped) return;
errorTimer->stop();
#ifdef APP_PHONON
mediaObject->stop();
#endif
if (downloadItem) {
downloadItem->stop();
delete downloadItem;
downloadItem = 0;
currentVideoSize = 0;
}
Video *video = playlistModel->videoAt(row);
if (!video) return;
videoAreaWidget->showLoading(video);
connect(video, SIGNAL(gotStreamUrl(QUrl)),
SLOT(gotStreamUrl(QUrl)), Qt::UniqueConnection);
connect(video, SIGNAL(errorStreamUrl(QString)),
SLOT(skip()), Qt::UniqueConnection);
video->loadStreamUrl();
// video title in titlebar
MainWindow::instance()->setWindowTitle(video->title() + " - " + Constants::NAME);
// ensure active item is visible
if (row != -1) {
QModelIndex index = playlistModel->index(row, 0, QModelIndex());
playlistView->scrollTo(index, QAbstractItemView::EnsureVisible);
}
// enable/disable actions
The::globalActions()->value("download")->setEnabled(
DownloadManager::instance()->itemForVideo(video) == 0);
The::globalActions()->value("previous")->setEnabled(row > 0);
The::globalActions()->value("stopafterthis")->setEnabled(true);
The::globalActions()->value("related-videos")->setEnabled(true);
bool enableDownload = video->license() == Video::LicenseCC;
#ifdef APP_ACTIVATION
enableDownload = enableDownload || Activation::instance().isLegacy();
#endif
#ifdef APP_DOWNLOADS
enableDownload = true;
#endif
QAction *a = The::globalActions()->value("download");
a->setEnabled(enableDownload);
a->setVisible(enableDownload);
updateSubscriptionAction(video, YTChannel::isSubscribed(video->channelId()));
foreach (QAction *action, currentVideoActions)
action->setEnabled(true);
#ifndef APP_PHONON_SEEK
QSlider *slider = MainWindow::instance()->getSlider();
slider->setEnabled(false);
slider->setValue(0);
#endif
if (snapshotSettings) {
delete snapshotSettings;
snapshotSettings = 0;
MainWindow::instance()->adjustStatusBarVisibility();
}
// see you in gotStreamUrl...
}