[TIMOB-2302] Android: VideoPlayer doesn't follow HTTP redirects
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Medium |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2011-04-17T01:58:42.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Release 1.6.0 M04 |
Components | Android |
Labels | android, defect, redirect, release-1.6.0, retest, video |
Reporter | Marshall Culpepper |
Assignee | Marshall Culpepper |
Created | 2011-04-15T03:16:10.000+0000 |
Updated | 2011-04-17T01:58:42.000+0000 |
Description
This is actually an android bug:
http://code.google.com/p/android/issues/detail?id=10810">http://code.google.com/p/android/issues/detail?id=10810
Attachments
File | Date | Size |
---|---|---|
device.png | 2011-04-15T03:16:11.000+0000 | 5449 |
(from [cd013b27782de574d44db8d9134118368b814c16]) try to follow http redirects since MediaPlayer can't handle them. also allow for the "url" property in the creation dict [#2302 state:fixed-in-qa] https://github.com/appcelerator/titanium_mobile/commit/cd013b27782de574d44db8d9134118368b814c16"> https://github.com/appcelerator/titanium_mobile/commit/cd013b27782d...
still fails to play.
http://pastie.org/1374155">http://pastie.org/1374155
incorrect test case.
fixed test case, still fails.
updated test case.
Moving this to TBS for now, but my hunch is that underlying issue is actually fixed, but the circumstances needed to play the video we're testing with are device / codec dependent.
Marshall look at ticket #2725 for another test case. That is still failing with a redirect. There may still be encoding issues with the source video, but the post redirect URL will at least play audio.
(from [b8b7bad9bb64c7626d109223f3f9edb5219497c7]) support redirects that use absolute paths as well as URLs [#2302 state:fixed-in-qa] [#2725]
https://github.com/appcelerator/titanium_mobile/commit/b8b7bad9bb64c7626d109223f3f9edb5219497c7"> https://github.com/appcelerator/titanium_mobile/commit/b8b7bad9bb64...
Using [INFO] Titanium SDK version: 1.6.0 (01/10/11 08:25 3452f06) and droid1 (2.2.1) G1 (1.6) and 2.1 emulator - Matts code and the code linked in #2725 fail with a rhino error and a classCastexception:
D/KrollContext( 3505): (kroll$3) [19424,31629] Running evaluated script: app://folder/2654.js
I/ActivityManager( 76): Starting activity: Intent { cmp=com.appcelerator.QAtests/ti.modules.titanium.media.TiVideoActivity (has extras) }
E/TiVideoActivity( 3505): (main) [148,31777] exiting onCreate
E/KrollMethod( 3505): (kroll$3) [4,31781] Exception calling kroll method add, invocation: null ]
E/KrollMethod( 3505): java.lang.ClassCastException: ti.modules.titanium.media.VideoPlayerProxy
E/KrollMethod( 3505): at org.appcelerator.titanium.proxy.TiViewProxyBindingGen$15.invoke(TiViewProxyBindingGen.java:662)
E/KrollMethod( 3505): at org.appcelerator.kroll.KrollMethod.call(KrollMethod.java:48)
E/KrollMethod( 3505): at org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:1711)
E/KrollMethod( 3505): at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:854)
E/KrollMethod( 3505): at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:164)
E/KrollMethod( 3505): at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:426)
E/KrollMethod( 3505): at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3161)
E/KrollMethod( 3505): at org.mozilla.javascript.InterpretedFunction.exec(InterpretedFunction.java:175)
E/KrollMethod( 3505): at org.mozilla.javascript.Context.evaluateReader(Context.java:1142)
E/KrollMethod( 3505): at org.appcelerator.titanium.kroll.KrollContext.evaluateScript(KrollContext.java:195)
E/KrollMethod( 3505): at org.appcelerator.titanium.kroll.KrollContext.handleEvalFile(KrollContext.java:220)
E/KrollMethod( 3505): at org.appcelerator.titanium.kroll.KrollContext.handleMessage(KrollContext.java:115)
E/KrollMethod( 3505): at android.os.Handler.dispatchMessage(Handler.java:95)
E/KrollMethod( 3505): at android.os.Looper.loop(Looper.java:123)
E/KrollMethod( 3505): at org.appcelerator.titanium.kroll.KrollHandlerThread.run(KrollHandlerThread.java:73)
I/ActivityManager( 76): Displayed activity com.appcelerator.QAtests/ti.modules.titanium.media.TiVideoActivity: 215 ms (total 215 ms)
E/KrollContext( 3505): (kroll$3) [109,31890] Error evaluating source: Wrapped java.lang.ClassCastException: ti.modules.titanium.media.VideoPlayerProxy (app://folder/2654.js#41)
E/KrollContext( 3505): org.mozilla.javascript.WrappedException: Wrapped java.lang.ClassCastException: ti.modules.titanium.media.VideoPlayerProxy (app://folder/2654.js#41)
E/KrollContext( 3505): at org.mozilla.javascript.Context.throwAsScriptRuntimeEx(Context.java:1781)
E/KrollContext( 3505): at org.appcelerator.kroll.KrollMethod.call(KrollMethod.java:85)
E/KrollContext( 3505): at org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:1711)
E/KrollContext( 3505): at script(app://folder/2654.js:41)
E/KrollContext( 3505): at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:854)
E/KrollContext( 3505): at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:164)
E/KrollContext( 3505): at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:426)
E/KrollContext( 3505): at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3161)
E/KrollContext( 3505): at org.mozilla.javascript.InterpretedFunction.exec(InterpretedFunction.java:175)
E/KrollContext( 3505): at org.mozilla.javascript.Context.evaluateReader(Context.java:1142)
E/KrollContext( 3505): at org.appcelerator.titanium.kroll.KrollContext.evaluateScript(KrollContext.java:195)
E/KrollContext( 3505): at org.appcelerator.titanium.kroll.KrollContext.handleEvalFile(KrollContext.java:220)
E/KrollContext( 3505): at org.appcelerator.titanium.kroll.KrollContext.handleMessage(KrollContext.java:115)
E/KrollContext( 3505): at android.os.Handler.dispatchMessage(Handler.java:95)
E/KrollContext( 3505): at android.os.Looper.loop(Looper.java:123)
E/KrollContext( 3505): at org.appcelerator.titanium.kroll.KrollHandlerThread.run(KrollHandlerThread.java:73)
E/KrollContext( 3505): Caused by: java.lang.ClassCastException: ti.modules.titanium.media.VideoPlayerProxy
E/KrollContext( 3505): at org.appcelerator.titanium.proxy.TiViewProxyBindingGen$15.invoke(TiViewProxyBindingGen.java:662)
E/KrollContext( 3505): at org.appcelerator.kroll.KrollMethod.call(KrollMethod.java:48)
E/KrollContext( 3505): ... 13 more
E/TiContext( 3505): (kroll$3) [104,31994] Rhino Error: app://folder/2654.js:41,0
E/TiContext( 3505): (kroll$3) [2,31996] Message: Wrapped java.lang.ClassCastException: ti.modules.titanium.media.VideoPlayerProxy (app://folder/2654.js#41)
E/TiContext( 3505): (kroll$3) [2,31998] Source: null
The code in #2725 is invalid. You cannot add a video view to a window. In matt's code there isn't a call to win.add(vid) so it shouldn't fail the same way.
ugh, sorry - Matts code produces http://pastie.org/1450474">http://pastie.org/1450474
"open()" doesn't exist on VideoPlayer in Android (never has) ... you have to simply use "play()"
Thanks Marshall, using play I saw the fix on a G2 (2.2) and emulator running 2.1, but on the g1 (1.6) I fail and see an alert "Video View. unknown error" with a button that says error. logcat says
D/KrollContext( 4368): (kroll$6) [5810,6996] Running evaluated script: app://folder/2302.js
I/TiAPI ( 4368): (kroll$6) [95,7091] createVideo Player
I/TiAPI ( 4368): (kroll$6) [57,7148] Done
I/TiAPI ( 4368): (kroll$6) [1937,9085] launch Movie
I/ActivityManager( 76): Starting activity: Intent { cmp=com.appcelerator.QAtests/ti.modules.titanium.media.TiVideoActivity (has extras) }
E/TiVideoActivity( 4368): (main) [57,9142] exiting onCreate
V/VideoView( 4368): reset duration to -1 in openVideo
I/InetAddress( 4368): Unknown host m.nbc.com, throwing UnknownHostException
D/MediaPlayer( 4368): Couldn't open file on client side, trying server side
I/ActivityManager( 76): Displayed activity com.appcelerator.QAtests/ti.modules.titanium.media.TiVideoActivity: 427 ms (total 427 ms)
E/PlayerDriver( 51): Command PLAYER_INIT completed with an error or info PVMFFailure
E/MediaPlayer( 4368): error (1, -1)
E/MediaPlayer( 4368): Error (1,-1)
D/VideoView( 4368): Error: 1,-1
W/PlayerDriver( 51): PVMFInfoErrorHandlingComplete
Hrm.. the error there is an UnknownHostException, is your G1 connected to the internet?
epic fail on my part. I'm done testing for the day. G1 works as expected.