Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-27493] Android: Videos do not play correctly on Android 5.1 (API 22)

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionFixed
Resolution Date2020-04-09T22:46:40.000+0000
Affected Version/sRelease 8.0.0, Release 8.2.1, Release 8.2.0, Release 8.3.0
Fix Version/sRelease 9.0.1
ComponentsAndroid
Labels22, android, engSchedule, freeze, lollipop, media, videoplayer
ReporterSohail Saddique
AssigneeGary Mathews
Created2019-10-23T10:34:02.000+0000
Updated2020-06-19T06:05:09.000+0000

Description

*Summary* When playing a video from URL using Media.VideoPlayer, the video freezes after 2-3 seconds and errors are displayed on Android 5.1 (API level 22). *Steps to reproduce*

Create a Classic titanium app project

Add the below code to _app.js_

Use any of the affected SDK versions (e.g. 8.2.0.GA)

Run on Android API 22 emulator or device

var window = Ti.UI.createWindow({ fullscreen: true });
var videoView = Ti.Media.createVideoPlayer({
	url: "http://assets.appcelerator.com.s3.amazonaws.com/video/media.m4v",
	autoplay: true,
	width: Ti.UI.FILL,
	height: Ti.UI.FILL,
});
window.add(videoView);
window.open();
*Result* The video freezes after 2-3 seconds. "Titanium apps have rich multimedia" is shown. Errors also displayed in terminal:
[WARN]  MediaHTTPConnection: readAt 3113714 / 32768 => java.net.ProtocolException
[ERROR] MediaPlayer: Should have subtitle controller already set
[DEBUG] EGL_emulation: eglMakeCurrent: 0xb42baa60: ver 2 0 (tinfo 0xb43a2e60)
[ERROR] MediaPlayer: error (1, -19)
[ERROR] MediaPlayer: Error (1,-19)
[DEBUG] TiVideoView8: (main) [27668,27793] Error: 1,-19
[DEBUG] EGL_emulation: eglMakeCurrent: 0xb42baa60: ver 2 0 (tinfo 0xb43a2e60)
[DEBUG] EGL_emulation: eglMakeCurrent: 0xb42baa60: ver 2 0 (tinfo 0xb43a2e60)
[WARN]  MediaPlayer: info/warning (3, 0)
[ERROR] MediaPlayer: error (1, -1004)
[ERROR] MediaPlayer: Error (1,-1004)
[DEBUG] TiVideoView8: (main) [2109,29902] Error: 1,-1004
*Expected Result* The video should play as normal and there should not be any errors in the terminal.

Comments

  1. Yordan Banev 2020-01-28

    I have at hand devices with Android 5.0 and Android 6.0. These are the closest APIs I can test with on real devices. On both the video plays correctly without errors against 8.3.0.GA. If you are able to share details about the device with Android 5.1, I can try to get something similar. As for emulator - I have had numerous problems with playing the video across all the supported APIs (also other videos), but I dare say streaming video on an Android emulator is not reliable in general.
  2. Gary Mathews 2020-02-18

    master: https://github.com/appcelerator/titanium_mobile/pull/11482
  3. Satyam Sekhri 2020-03-21

    FR Passed on master. Master branch merged.
  4. Satyam Sekhri 2020-03-21

    [~gmathews], need to cherry-pick the changes to 9_0_X branch
  5. Gary Mathews 2020-03-24

    9_0_X: https://github.com/appcelerator/titanium_mobile/pull/11560
  6. Satyam Sekhri 2020-03-24

    FR Passed on 9_0_X branch. 9_0_X branch merged.
  7. Samir Mohammed 2020-04-01

    Reopening ticket as application crashes with the following error once the video is played.
       [ERROR]  InputEventReceiver: Exception dispatching input event.
       [ERROR]  E/MessageQueue-JNI: Exception in MessageQueue callback: handleReceiveCallback
       [ERROR]  E/MessageQueue-JNI: java.lang.IllegalStateException
       [ERROR]  E/MessageQueue-JNI: at android.media.MediaPlayer.getCurrentPosition(Native Method)
       [ERROR]  E/MessageQueue-JNI: at android.widget.TiVideoView8.getCurrentPosition(TiVideoView8.java:853)
       [ERROR]  E/MessageQueue-JNI: at android.widget.MediaController.setProgress(MediaController.java:458)
       [ERROR]  E/MessageQueue-JNI: at android.widget.MediaController.show(MediaController.java:378)
       [ERROR]  E/MessageQueue-JNI: at android.widget.MediaController.show(MediaController.java:334)
       [ERROR]  E/MessageQueue-JNI: at android.widget.TiVideoView8.toggleMediaControlsVisiblity(TiVideoView8.java:760)
       [ERROR]  E/MessageQueue-JNI: at android.widget.TiVideoView8.onTouchEvent(TiVideoView8.java:714)
       [ERROR]  E/MessageQueue-JNI: at android.view.View.dispatchTouchEvent(View.java:13415)
       [ERROR]  E/MessageQueue-JNI: at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3060)
       [ERROR]  E/MessageQueue-JNI: at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2698)
       [ERROR]  E/MessageQueue-JNI: at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3060)
       [ERROR]  E/MessageQueue-JNI: at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2698)
       [ERROR]  E/MessageQueue-JNI: at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3060)
       [ERROR]  E/MessageQueue-JNI: at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2698)
       [ERROR]  E/MessageQueue-JNI: at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3060)
       [ERROR]  E/MessageQueue-JNI: at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2698)
       [ERROR]  E/MessageQueue-JNI: at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3060)
       [ERROR]  E/MessageQueue-JNI: at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2698)
       [ERROR]  E/MessageQueue-JNI: at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3060)
       [ERROR]  E/MessageQueue-JNI: at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2698)
       [ERROR]  E/MessageQueue-JNI: at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3060)
       [ERROR]  E/MessageQueue-JNI: at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2698)
       [ERROR]  E/MessageQueue-JNI: at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3060)
       [ERROR]  E/MessageQueue-JNI: at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2698)
       [ERROR]  E/MessageQueue-JNI: at com.android.internal.policy.DecorView.superDispatchTouchEvent(DecorView.java:465)
       [ERROR]  E/MessageQueue-JNI: at com.android.internal.policy.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1849)
       [ERROR]  E/MessageQueue-JNI: at android.app.Activity.dispatchTouchEvent(Activity.java:3993)
       [ERROR]  E/MessageQueue-JNI: at androidx.appcompat.view.WindowCallbackWrapper.dispatchTouchEvent(WindowCallbackWrapper.java:69)
       [ERROR]  E/MessageQueue-JNI: at com.android.internal.policy.DecorView.dispatchTouchEvent(DecorView.java:423)
       [ERROR]  E/MessageQueue-JNI: at android.view.View.dispatchPointerEvent(View.java:13674)
       [ERROR]  E/MessageQueue-JNI: at android.view.ViewRootImpl$ViewPostImeInputStage.processPointerEvent(ViewRootImpl.java:5482)
       [ERROR]  E/MessageQueue-JNI: at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:5285)
       [ERROR]  E/MessageQueue-JNI: at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4788)
       [ERROR]  E/MessageQueue-JNI: at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:4841)
       [ERROR]  E/MessageQueue-JNI: at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4807)
       [ERROR]  E/MessageQueue-JNI: at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:4947)
       [ERROR]  E/MessageQueue-JNI: at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:4815)
       [ERROR]  E/MessageQueue-JNI: at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:5004)
       [ERROR]  E/MessageQueue-JNI: at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4788)
       [ERROR]  E/MessageQueue-JNI: at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:4841)
       [ERROR]  E/MessageQueue-JNI: at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4807)
       [ERROR]  E/MessageQueue-JNI: at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:4815)
       [ERROR]  E/MessageQueue-JNI: at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4788)
       [ERROR]  E/MessageQueue-JNI: at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:7505)
       [ERROR]  E/MessageQueue-JNI: at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:7474)
       [ERROR]  E/MessageQueue-JNI: at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:7435)
       [ERROR]  E/MessageQueue-JNI: at android.view.ViewRootImpl$WindowInputEventReceiver.onInputEvent(ViewRootImpl.java:7630)
       [ERROR]  E/MessageQueue-JNI: at android.view.InputEventReceiver.dispatchInputEvent(InputEventReceiver.java:188)
       [ERROR]  E/MessageQueue-JNI: at android.os.MessageQueue.nativePollOnce(Native Method)
       [ERROR]  E/MessageQueue-JNI: at android.os.MessageQueue.next(MessageQueue.java:336)
       [ERROR]  E/MessageQueue-JNI: at android.os.Looper.loop(Looper.java:174)
       [ERROR]  E/MessageQueue-JNI: at android.app.ActivityThread.main(ActivityThread.java:7356)
       [ERROR]  E/MessageQueue-JNI: at java.lang.reflect.Method.invoke(Native Method)
       [ERROR]  E/MessageQueue-JNI: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
       [ERROR]  E/MessageQueue-JNI: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)
       [INFO]   APSAnalyticsStore: crash.report
       [ERROR]  TiExceptionHandler: (main) [7,46880] null
       [ERROR]  TiExceptionHandler:
       [ERROR]  TiExceptionHandler: android.media.MediaPlayer.getCurrentPosition(Native Method)
       [ERROR]  TiExceptionHandler: android.widget.TiVideoView8.getCurrentPosition(TiVideoView8.java:853)
       [ERROR]  TiExceptionHandler: android.widget.MediaController.setProgress(MediaController.java:458)
       [ERROR]  TiExceptionHandler: android.widget.MediaController.show(MediaController.java:378)
       [ERROR]  TiExceptionHandler: android.widget.MediaController.show(MediaController.java:334)
       [ERROR]  TiExceptionHandler: android.widget.TiVideoView8.toggleMediaControlsVisiblity(TiVideoView8.java:760)
       [ERROR]  TiExceptionHandler: android.widget.TiVideoView8.onTouchEvent(TiVideoView8.java:714)
       [ERROR]  TiExceptionHandler: android.view.View.dispatchTouchEvent(View.java:13415)
       [ERROR]  TiExceptionHandler: android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3060)
       [ERROR]  TiExceptionHandler: android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2698)
       [ERROR]  TiExceptionHandler: android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3060)
       [ERROR]  TiExceptionHandler: android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2698)
       [ERROR]  TiExceptionHandler: android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3060)
       [ERROR]  TiExceptionHandler: android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2698)
       [ERROR]  TiExceptionHandler: android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3060)
       [ERROR]  TiExceptionHandler: android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2698)
       [ERROR]  TiExceptionHandler: android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3060)
       [ERROR]  TiExceptionHandler: android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2698)
       [ERROR]  TiExceptionHandler: android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3060)
       [ERROR]  TiExceptionHandler: android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2698)
       [ERROR]  TiExceptionHandler: android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3060)
       [ERROR]  TiExceptionHandler: android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2698)
       [ERROR]  TiExceptionHandler: android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3060)
       [ERROR]  TiExceptionHandler: android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2698)
       [ERROR]  TiExceptionHandler: com.android.internal.policy.DecorView.superDispatchTouchEvent(DecorView.java:465)
       [ERROR]  TiExceptionHandler: com.android.internal.policy.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1849)
       [ERROR]  TiExceptionHandler: android.app.Activity.dispatchTouchEvent(Activity.java:3993)
       [ERROR]  TiExceptionHandler: androidx.appcompat.view.WindowCallbackWrapper.dispatchTouchEvent(WindowCallbackWrapper.java:69)
       [ERROR]  TiExceptionHandler: com.android.internal.policy.DecorView.dispatchTouchEvent(DecorView.java:423)
       [ERROR]  TiExceptionHandler: android.view.View.dispatchPointerEvent(View.java:13674)
       [ERROR]  TiExceptionHandler: android.view.ViewRootImpl$ViewPostImeInputStage.processPointerEvent(ViewRootImpl.java:5482)
       [ERROR]  TiExceptionHandler: android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:5285)
       [ERROR]  TiExceptionHandler: android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4788)
       [ERROR]  TiExceptionHandler: android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:4841)
       [ERROR]  TiExceptionHandler: android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4807)
       [ERROR]  TiExceptionHandler: android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:4947)
       [ERROR]  TiExceptionHandler: android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:4815)
       [ERROR]  TiExceptionHandler: android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:5004)
       [ERROR]  TiExceptionHandler: android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4788)
       [ERROR]  TiExceptionHandler: android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:4841)
       [ERROR]  TiExceptionHandler: android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4807)
       [ERROR]  TiExceptionHandler: android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:4815)
       [ERROR]  TiExceptionHandler: android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4788)
       [ERROR]  TiExceptionHandler: android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:7505)
       [ERROR]  TiExceptionHandler: android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:7474)
       [ERROR]  TiExceptionHandler: android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:7435)
       [ERROR]  TiExceptionHandler: android.view.ViewRootImpl$WindowInputEventReceiver.onInputEvent(ViewRootImpl.java:7630)
       [ERROR]  TiExceptionHandler: android.view.InputEventReceiver.dispatchInputEvent(InputEventReceiver.java:188)
       [ERROR]  TiExceptionHandler: android.os.MessageQueue.nativePollOnce(Native Method)
       [ERROR]  TiExceptionHandler: android.os.MessageQueue.next(MessageQueue.java:336)
       [ERROR]  TiExceptionHandler: android.os.Looper.loop(Looper.java:174)
       [ERROR]  TiExceptionHandler: android.app.ActivityThread.main(ActivityThread.java:7356)
       [ERROR]  TiExceptionHandler: java.lang.reflect.Method.invoke(Native Method)
       [ERROR]  TiExceptionHandler: com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
       [ERROR]  TiExceptionHandler: com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)
       
    *Test Environment*
       SDK version 9.1.0.v20200331065959. and 9.0.1.v20200331084758
       MacOS Catalina: 10.15.1 beta
       Xcode: 11.3
       Java Version: 1.8.0_131
       Android NDK: 21.1.6273396-beta2
       Node.js: 10.16.3
       ""NPM":"5.0.0-1","CLI":"8.0.0-master.10""
       Pixel Xl 7.1.1 Sim
       
  8. Gary Mathews 2020-04-09

    master: https://github.com/appcelerator/titanium_mobile/pull/11608 9_0_X: https://github.com/appcelerator/titanium_mobile/pull/11609
  9. Samir Mohammed 2020-04-09

    FR Passed on Master and 9_0_X, waiting on Jenkins build
  10. Christopher Williams 2020-04-09

    merged to master and 9_0_X
  11. Satyam Sekhri 2020-04-09

    Verified on: Mac OS: 10.15.4 SDK: 9.0.1.v20200409100807, 9.1.0.v20200409073825 Appc CLI: 8.0.0 JDK: 11.0.4 Node: 10.17.0 Studio: 6.0.0.202003132109 Device: Nexus4(v5.1.1) device, Pixel3(v10.0) emulator,

JSON Source