Name is required.
Email address is required.
Invalid email address
Answer is required.
Exceeding max length of 5KB

Android SDK Audio Streaming

i want to play audio stream with JWPlayerView. so far no problem.
but i want to use it in a background service. so i tried to create to JWPlayerView programmatically within the service but with the context of the service.
the audio is played but if the device is moving the app crash. it throwing that exception ClassCastException

java.lang.ClassCastException: cannot be cast to at com.longtailvideo.jwplayer.b.h$1.onOrientationChanged(SourceFile:29)
at android.view.OrientationEventListener$SensorEventListenerImpl.onSensorChanged(
at android.hardware.SystemSensorManager$SensorEventQueue.dispatchSensorEvent(
at android.os.MessageQueue.nativePollOnce(Native Method)
at android.os.Looper.loop(
at java.lang.reflect.Method.invoke(Native Method)

it happened because the OrientationEventListener. is there any way to disable it that so the app won't crash?
you can see how this is happend in my example code

1 Community Answers


JW Player Support Agent  
0 rated :

Hello Michael,

Try this as an alternative:

This question has received the maximum number of answers.