Bug 54488 - <audio> tag doesn't report 'canplay' until 'played' altough autobuffer/preload
Summary: <audio> tag doesn't report 'canplay' until 'played' altough autobuffer/preload
Status: RESOLVED WORKSFORME
Alias: None
Product: WebKit
Classification: Unclassified
Component: Media (show other bugs)
Version: 528+ (Nightly build)
Hardware: Mac (Intel) Other
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-02-15 12:25 PST by StuFF mc
Modified: 2011-02-18 21:04 PST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description StuFF mc 2011-02-15 12:25:55 PST
<!DOCTYPE html>
<html>
     <body>
     		<h1>initializing...</h1>
        <audio controls src="http://stream.radiocampusparis.org:8000/stream_rcp.mp3" preload="auto" autobuffer></audio>
        <script type="text/javascript">
        		function log(text) {
	        		document.getElementsByTagName("h1")[0].innerHTML = text; 
        		}
						log("loading...");

						myAudio2 = document.getElementsByTagName("audio")[0];
						myAudio2.addEventListener('canplay', function () {
                log('Audio Ready to play!');
              });
        </script>    
      </body>
</html>


Try this code on iOS or Android OS, not working. Working fine on WebOS. There's a bug open for Chrome: http://code.google.com/p/chromium/issues/detail?id=68006 and Android: http://code.google.com/p/android/issues/detail?id=14753&colspec=ID%20Type%20Status%20Owner%20Summary%20Stars
Comment 1 Eric Carlson 2011-02-18 21:04:31 PST
This works correctly in desktop Safari. It does not work as written on iOS because audio and video data does not load until the user requests playback.