Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    HTML5 Audio events with QWebView

    Qt WebKit
    1
    1
    733
    Loading More Posts
    • 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
      paulzwerky87 last edited by

      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 Reply Quote 0
      • First post
        Last post