Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-9114] Android: Mobile video doesn't play

GitHub Issuen/a
TypeBug
PriorityLow
StatusClosed
ResolutionWon't Fix
Resolution Date2017-07-27T21:08:29.000+0000
Affected Version/sRelease 2.0.1
Fix Version/sn/a
ComponentsAndroid
Labelscore
ReporterOnur YALAZI
AssigneeEric Merriman
Created2012-05-04T04:22:46.000+0000
Updated2017-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();
}

Comments

  1. Onur YALAZI 2012-05-04

    I'm using Titanium mobile sdk 2.0.1-GA2
  2. Onur YALAZI 2012-05-04

    The same code plays well with Galaxy SII android 2.3.6
  3. Onur YALAZI 2012-05-05

    Seems like Timob has a problem on android 4.0.3 and video files stored in Resources.
  4. Junaid Younus 2012-05-11

    Moved to the appropriate section.
  5. Lee Morris 2017-07-27

    Closing due to inactivity. If this issue still exists, please raise a new ticket.

JSON Source