Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt WebKit
  4. HTML5 Audio events with QWebView
Forum Updated to NodeBB v4.3 + New Features

HTML5 Audio events with QWebView

Scheduled Pinned Locked Moved Qt WebKit
1 Posts 1 Posters 870 Views 1 Watching
  • 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.
  • P Offline
    P Offline
    paulzwerky87
    wrote on last edited by
    #1

    Trying to get the hooks for the audio tag events in the HTML5 through QtWeKit. For that I created a sample application that just loads a html file through QwebView.

    The html file contains a HTML5 audio tag.

    <audio id="audio_with_local_controls" controls>
    <source src="nokia-tune.mp3" type="audio/mp3" />
    </audio>
    In the script side, I'm trying to get the hooks for the audio tag play, pause and ended events.

    /// AUDIO TAG EVENTS.

    var aid = document.getElementById('audio_with_local_controls');

    function onplay_(){
    console.log('onplay');
    alert('onplay');
    }

    function oncanplay_(){
    console.log('oncanplay');
    alert('oncanplay');
    }

    function onpause_(){
    console.log('onpause');
    alert('onpause');
    }

    console.log(aid);

    aid.onplay = onplay_;
    aid.oncanplay = oncanplay_;
    aid.onpause = onpause_;
    aid.onprogress = function onprogress_(){ alert('onprogress'); }
    aid.onended = function onended_(){ alert('onended'); }
    aid.onabort = function onabort_(){ alert('onabort'); }

    The code sequence might not make sense as I was trying something up and down in the code. Chrome was able to capture the hooks. But QWebView remains silent on this, nothing gets captured. Is it that QWebView doesn't support this? or Am I writing something wrong?

    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 Extensions
    • Unsolved