[TIMOB-9114] Android: Mobile video doesn't play
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Low |
Status | Closed |
Resolution | Won't Fix |
Resolution Date | 2017-07-27T21:08:29.000+0000 |
Affected Version/s | Release 2.0.1 |
Fix Version/s | n/a |
Components | Android |
Labels | core |
Reporter | Onur YALAZI |
Assignee | Eric Merriman |
Created | 2012-05-04T04:22:46.000+0000 |
Updated | 2017-07-27T21:08:29.000+0000 |
Description
The sample video (http://assets.appcelerator.com.s3.amazonaws.com/video/media.m4v) can be played if it's online but can't be played if it's in resources folder. Playback starts with audio only and stops when the controls disappear. MediaControlStyle does not matter.
I also tried some videos encoded with various default profiles available with handbrake. They can't be played.
If I create a java application and play them from sdcard there is no problem with playback.
Related Code:
var v = Ti.Media.createVideoPlayer({
top : 2,
autoplay : false,
});
b2 = Ti.UI.createButton({
title: 'start local',
bottom: 50,
width: 200,
height: 40
});
b2.addEventListener('click', function() {
file = 'media.mp4';
v.url = file;
v.play();
});
Related Java Code:
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
mVideoView = (VideoView) findViewById(R.id.videoView1);
private String path = Environment.getExternalStorageDirectory().getPath() + "/VIDEO/f1-1.mp4";
mVideoView.setVideoPath(path);
mVideoView.setMediaController(new MediaController(this));
mVideoView.requestFocus();
mVideoView.start();
}
I'm using Titanium mobile sdk 2.0.1-GA2
The same code plays well with Galaxy SII android 2.3.6
Seems like Timob has a problem on android 4.0.3 and video files stored in Resources.
Moved to the appropriate section.
Closing due to inactivity. If this issue still exists, please raise a new ticket.