[TIMOB-27493] Android: Videos do not play correctly on Android 5.1 (API 22)
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Medium |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2020-04-09T22:46:40.000+0000 |
Affected Version/s | Release 8.0.0, Release 8.2.1, Release 8.2.0, Release 8.3.0 |
Fix Version/s | Release 9.0.1 |
Components | Android |
Labels | 22, android, engSchedule, freeze, lollipop, media, videoplayer |
Reporter | Sohail Saddique |
Assignee | Gary Mathews |
Created | 2019-10-23T10:34:02.000+0000 |
Updated | 2020-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.
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.
master: https://github.com/appcelerator/titanium_mobile/pull/11482
FR Passed on master. Master branch merged.
[~gmathews], need to cherry-pick the changes to 9_0_X branch
9_0_X: https://github.com/appcelerator/titanium_mobile/pull/11560
FR Passed on 9_0_X branch. 9_0_X branch merged.
Reopening ticket as application crashes with the following error once the video is played.
*Test Environment*
master: https://github.com/appcelerator/titanium_mobile/pull/11608 9_0_X: https://github.com/appcelerator/titanium_mobile/pull/11609
FR Passed on Master and 9_0_X, waiting on Jenkins build
merged to master and 9_0_X
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,