nexcra / bst-player

Automatically exported from code.google.com/p/bst-player
0 stars 0 forks source link

Flash player not working with ranged stream #52

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Hello,

I downloaded and used the 1.3 version of the player. I'm trying to link it to a 
servlet I developped, which streams music from my database.
I think that the servlet is OK because I can listen to my music using JPlayer 
(native & flash) or directly from the browser.

It's very strange, because if I give an basic www url to an mp3, your library 
works... but when poiting to my servlet, it doesn't. I tried to stream the data 
in one big response (http code 200) or multiple (206 with ranges), it does not 
work (I have the latest Flash player and GWT 2.4). 

Here are the http headers (when using ranges, but same result when using 1 
single large response) :

Request 
URL:http://localhost:8080/war/zoomedia/stream?alb=14&sid=419BC159FC8FAF263B241EA
0327E8608
Request Method:GET
Status Code:206 Contenu Partiel
Request Headersview source
Accept:*/*
Accept-Charset:ISO-8859-1,utf-8;q=0.7,*;q=0.3
Accept-Encoding:gzip,deflate,sdch
Accept-Language:en,fr-FR;q=0.8,fr;q=0.6,en-US;q=0.4
Connection:keep-alive
Cookie:sessionid=419BC159FC8FAF263B241EA0327E8608; 
JSESSIONID=419BC159FC8FAF263B241EA0327E8608
Host:localhost:8080
Referer:http://localhost:8080/war/zoomedia/bst-flash-player-1.3.swf
User-Agent:Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.7 (KHTML, like 
Gecko) Chrome/16.0.912.75 Safari/535.7
Query String Parametersview URL encoded
alb:14
sid:419BC159FC8FAF263B241EA0327E8608
Response Headersview source
Accept-Ranges:bytes
Connection:Keep-Alive
Content-Length:500000
Content-Range:bytes 0-499999/15479064
Content-Type:audio/mpeg
Date:Sat, 21 Jan 2012 15:11:17 GMT
Keep-Alive:timeout=15, max=99
Server:Apache-Coyote/1.1
last-modified-time:Sat, 21 Jan 2012 15:11:18 GMT

-> In the player the displayed time is: 00:00 / 00:4294967295 
-> I sometimes have this exception in GWT (in debug mode):

com.google.gwt.core.client.JavaScriptException: (TypeError): Object [object 
DOMWindow] has no method 'play'
    at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:248)
    at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:136)
    at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:561)
    at com.google.gwt.dev.shell.ModuleSpace.invokeNativeVoid(ModuleSpace.java:289)
    at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeVoid(JavaScriptHost.java:107)
    at com.bramosystems.oss.player.core.client.impl.FlashMediaPlayerImpl$.playMedia$(FlashMediaPlayerImpl.java)
    at com.bramosystems.oss.player.core.client.ui.FlashMediaPlayer.playMedia(FlashMediaPlayer.java:402)

In tomcat, I always have this exception, seems that the player closes the 
connection before I have time to send all the bytes:

ClientAbortException:  java.net.SocketException: Software caused connection 
abort: socket write error
        at org.apache.catalina.connector.OutputBuffer.realWriteBytes(OutputBuffer.java:370)
        at org.apache.tomcat.util.buf.ByteChunk.flushBuffer(ByteChunk.java:432)
        at org.apache.tomcat.util.buf.ByteChunk.append(ByteChunk.java:291)
        at org.apache.catalina.connector.OutputBuffer.writeByte(OutputBuffer.java:418)
        at org.apache.catalina.connector.CoyoteOutputStream.write(CoyoteOutputStream.java:77)
        at com.zoomedia.server.RangeInputStreamer.copyData(RangeInputStreamer.java:50)
        at com.zoomedia.server.StreamingServlet.doGet(StreamingServlet.java:191)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:627)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:172)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
        at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:581)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174)
        at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:873)
        at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java
:665)
        at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
        at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
        at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
        at java.lang.Thread.run(Thread.java:619)
Caused by: java.net.SocketException: Software caused connection abort: socket 
write error
        at java.net.SocketOutputStream.socketWrite0(Native Method)
        at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:92)
        at java.net.SocketOutputStream.write(SocketOutputStream.java:136)
        at org.apache.coyote.http11.InternalOutputBuffer.realWriteBytes(InternalOutputBuffer.java:750)
        at org.apache.tomcat.util.buf.ByteChunk.flushBuffer(ByteChunk.java:432)
        at org.apache.tomcat.util.buf.ByteChunk.append(ByteChunk.java:347)
        at org.apache.coyote.http11.InternalOutputBuffer$OutputStreamOutputBuffer.doWrite(InternalOutputBuffer.java:773)

        at org.apache.coyote.http11.filters.IdentityOutputFilter.doWrite(IdentityOutputFilter.java:118)
        at org.apache.coyote.http11.InternalOutputBuffer.doWrite(InternalOutputBuffer.java:583)
        at org.apache.coyote.Response.doWrite(Response.java:560)
        at org.apache.catalina.connector.OutputBuffer.realWriteBytes(OutputBuffer.java:365)
        ... 23 more

Do you have any idea why it does not work ? I'll be glad to help if you want 
more information's.

Regards,

Thomas

Original issue reported on code.google.com by public.t...@gmail.com on 21 Jan 2012 at 3:17

GoogleCodeExporter commented 9 years ago
Hi,

As a workaround, let your URL end in ".mp3" dummy parameter.

HTH.

Original comment by sbrah...@gmail.com on 25 Jan 2012 at 8:57

GoogleCodeExporter commented 9 years ago
Thank you very much. If I add that dummy parameter, I get rid of those errors.
The only small problem I still have is that the player only loads the first 
range of the stream (see the response headers in my 1st post) and never 
requests the next ones. Is it a limitation of your flash player, or are there 
some missing headers you may require ?

Thomas

Original comment by public.t...@gmail.com on 25 Jan 2012 at 3:57

GoogleCodeExporter commented 9 years ago
The flash player had not been tested with ranged streams.  I will look into 
that when am little less busy.

Original comment by sbrah...@gmail.com on 26 Jan 2012 at 12:51

GoogleCodeExporter commented 9 years ago
hi, I have this problem too, if any one solve that please help me.

Original comment by mohammad...@gmail.com on 22 Feb 2012 at 11:10