Closed Bug 640597 Opened 13 years ago Closed 13 years ago

Audio stream is not played immediately using javascript

Categories

(Core :: Audio/Video, defect)

x86_64
Windows 7
defect
Not set
normal

Tracking

()

VERIFIED DUPLICATE of bug 628665

People

(Reporter: 1.april, Unassigned)

References

()

Details

User-Agent:       Mozilla/5.0 (Windows NT 5.1; rv:2.0) Gecko/20100101 Firefox/4.0
Build Identifier: 

I`m developing Firefox 4 extension for streaming live ogg radio stream.
I don`t want to use flash player, according to new Mozilla`s restriction about embedding .sfw code. 

I`ve implemented <audio> tag and would like to control it over javascript, but I found out, that using javascript is not the same as using default controls panel.

In video you can see (sorry that you can`t actually hear). But in first half of video, i`m running my player by clicking on play pause button and the stream is playing well.

But when controlling playing from javascript using:

player = document.getElementById('onair_htmlplayer');   
player.setAttribute('src', "http://example.com/stream_128.ogg");      
player.play();      

Player loads 20 seconds before playing anything. This is unacceptable in term that user can`t know wheater the stream is loading or he didn`t press start button.

To summarize all:
Loading of stream is very long when controling through javascript in comparision with default built-in controls.

Please debug that :)

Reproducible: Always

Steps to Reproduce:
1.press key with loading function
2.wait far too long for actualy hearing the stream
3.listening the radio, feeling nice :)
Actual Results:  
you hear stream after 20 seconds of waiting

Expected Results:  
you want to hear stream in max 3-5 seconds timeout

For source codes or everything just drop me line on marek@chrenko.net
I`ll reply as soon as possible, this problem occures on my Windows 7 and Windows XP computers. Running Firefox 4 RC1.
Component: General → Video/Audio
QA Contact: general → video.audio
This is fixed by bug 628665, which won't land until after FF4.

In the meantime you can work around this by setting the autoplay attribute on your audio element, rather than calling 'play()' directly. Or call 'play()' in a canplaythrough event handler.
Status: UNCONFIRMED → RESOLVED
Closed: 13 years ago
Resolution: --- → DUPLICATE
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.