当前位置: 首页>>代码示例>>C++>>正文


C++ Video::loadStreamUrl方法代码示例

本文整理汇总了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();
}
开发者ID:flaviotordini,项目名称:minitube,代码行数:35,代码来源:mediaview.cpp

示例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)));
}
开发者ID:KDE,项目名称:plasma-mediacenter,代码行数:8,代码来源:videodetailsmodel.cpp

示例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...
}
开发者ID:PatMart,项目名称:minitube,代码行数:72,代码来源:mediaview.cpp


注:本文中的Video::loadStreamUrl方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。