MediaPlayerStream question.

NJDude

Expert
Licensed User
Longtime User
The instruction: "mp.Release" when can be used?, and if used, what it has to be done to play another stream, I keep getting "illegal errors", I've noticed that if you just "stop" the stream continues downloading.

Any help will be appreciate it.
 

NJDude

Expert
Licensed User
Longtime User
Ok, something like this?

B4X:
Sub Process_Globals

      Dim m As As MediaPlayerStream

End Sub

....

Sub PlaySomething

...

       m.Stop
       m.Release
       Dim m As As MediaPlayerStream
       m.Initialize("m")

End Sub
 
Upvote 0

vb1992

Well-Known Member
Licensed User
Longtime User
I had a user give me this error:
Is this the same error as NJ DUDE?


Cause ANR keyDispatchingTimedOut

B4X:
DALVIK THREADS:
(mutexes: tll=0 tsl=0 tscl=0 ghl=0 hwl=0 hwll=0)
"main" prio=5 tid=1 NATIVE
  | group="main" sCount=1 dsCount=0 obj=0x40027550 self=0xcfc0
  | sysTid=23859 nice=0 sched=0/0 cgrp=default handle=-1345006240
  | schedstat=( 449951179 618225094 484 )
  at android.media.MediaPlayer.native_setup(Native Method)
  at android.media.MediaPlayer.<init>(MediaPlayer.java:555)
  at anywheresoftware.b4a.objects.MediaPlayerWrapper.Initialize(MediaPlayerWrapper.java:37)
  at anywheresoftware.b4a.objects.MediaPlayerWrapper.Initialize2(MediaPlayerWrapper.java:44)
  at anywheresoftware.b4a.audio.MediaPlayerStreamWrapper.Initialize(MediaPlayerStreamWrapper.java:64)
  at Android.Beta.Radio.main._activity_resume(main.java:276)
  at java.lang.reflect.Method.invokeNative(Native Method)
  at java.lang.reflect.Method.invoke(Method.java:507)
  at anywheresoftware.b4a.BA.raiseEvent2(BA.java:105)
  at anywheresoftware.b4a.BA.raiseEvent(BA.java:89)
  at Android.Beta.Radio.main.afterFirstLayout(main.java:90)
  at Android.Beta.Radio.main.access$100(main.java:16)
  at Android.Beta.Radio.main$WaitForLayout.run(main.java:72)
  at android.os.Handler.handleCallback(Handler.java:587)
  at android.os.Handler.dispatchMessage(Handler.java:92)
  at android.os.Looper.loop(Looper.java:143)
  at android.app.ActivityThread.main(ActivityThread.java:4196)
  at java.lang.reflect.Method.invokeNative(Native Method)
  at java.lang.reflect.Method.invoke(Method.java:507)
  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
  at dalvik.system.NativeStart.main(Native Method)



"Binder Thread #2" prio=5 tid=7 NATIVE
| group="main" sCount=1 dsCount=0 obj=0x4051ad58 self=0x157250
| sysTid=23865 nice=0 sched=0/0 cgrp=default handle=2417392
| schedstat=( 4913330 2929687 30 )
at dalvik.system.NativeStart.run(Native Method)

"Binder Thread #1" prio=5 tid=6 NATIVE
| group="main" sCount=1 dsCount=0 obj=0x40517a88 self=0x30ca88
| sysTid=23864 nice=0 sched=0/0 cgrp=default handle=3091976
| schedstat=( 7781986 21820069 39 )
at dalvik.system.NativeStart.run(Native Method)

"Compiler" daemon prio=5 tid=5 VMWAIT
| group="system" sCount=1 dsCount=0 obj=0x405166b8 self=0x30c950
| sysTid=23863 nice=0 sched=0/0 cgrp=default handle=3091680
| schedstat=( 31677239 4882810 115 )
at dalvik.system.NativeStart.run(Native Method)

"Signal Catcher" daemon prio=5 tid=4 RUNNABLE
| group="system" sCount=0 dsCount=0 obj=0x405165f8 self=0x2f2ba8
| sysTid=23862 nice=0 sched=0/0 cgrp=default handle=741992
| schedstat=( 2563476 3479004 12 )
at dalvik.system.NativeStart.run(Native Method)

"GC" daemon prio=5 tid=3 VMWAIT
| group="system" sCount=1 dsCount=0 obj=0x40516550 self=0x157e80
| sysTid=23861 nice=0 sched=0/0 cgrp=default handle=703640
| schedstat=( 33508305 70373532 30 )
at dalvik.system.NativeStart.run(Native Method)

"HeapWorker" daemon prio=5 tid=2 VMWAIT
| group="system" sCount=1 dsCount=0 obj=0x40516498 self=0x157d48
| sysTid=23860 nice=0 sched=0/0 cgrp=default handle=1411776
| schedstat=( 39581296 37567140 13 )
at dalvik.system.NativeStart.run(Native Method)
 
Last edited:
Upvote 0

vb1992

Well-Known Member
Licensed User
Longtime User
Did you create multiple instances of MediaPlayer?

Nope, I do load a new stream by clicking a [NEXT]
button, that calls MediaPLayerStream.Load("url_goes_here)")

I am wondering how MediaPlayerStream handles a timeout?
If the person has a slow connection and it can't get to the
stream and times out...
 
Upvote 0
Top