Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. How QWebView HTML video.play() emit url to QMediaPlayer?
Qt 6.12 LTS is out! See what's new in the release blog

How QWebView HTML video.play() emit url to QMediaPlayer?

Scheduled Pinned Locked Moved Unsolved General and Desktop
1 Posts 1 Posters 582 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • sonichyS Offline
    sonichyS Offline
    sonichy
    wrote on last edited by sonichy
    #1

    alt text

    webview = new QWebView;
    webview->load(QUrl("http://m.91kds.net/"));
    ui->tabWidget->insertTab(0,webview,"91KDS");
    ......
    QWebFrame *frame = webView->page()->currentFrame();
    QWebElement document = frame->documentElement();
    QWebElement video = document.findFirst("video");
    QString surl = video.attribute("src");
    qDebug() << "91KDS" << surl;
    .....
    player = new QMediaPlayer;
    player->play(surl);

    https://github.com/sonichy

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt
    • Unsolved