I have an Activity that plays progressively streaming videos and is coded as follows:
Layout
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<VideoView android:id="@+id/myVideo"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_gravity="center"/>
</LinearLayout>
Activity
public class PlayVideo extends Activity {
public ProgressDialog progressDialog;
/** Called when the activity is first created. */
@Override
public void onCreate( Bundle savedInstanceState ) {
super.onCreate( savedInstanceState );
setContentView( R.layout.video );
progressDialog = ProgressDialog.show( this, "", "Loading...", true );
Intent i = getIntent();
startVideo( i.getStringExtra( "videoUrl" ) );
}
public void startVideo( String videoUrl ) {
final VideoView videoView = ( VideoView ) findViewById( R.id.myVideo );
videoView.setMediaController( new MediaController( this ) );
videoView.setVideoURI( Uri.parse( videoUrl ) );
videoView.setOnPreparedListener( new OnPreparedListener() {
public void onPrepared( MediaPlayer arg0 ) {
progressDialog.dismiss();
videoView.requestFocus();
videoView.start();
}
} );
}
}
This works fine on most devices, however my client has two devices, one is a samsung galaxy ace running 2.2. And the other one is a ideos U8150 (running 2.2), videos will not play on these two devices. The ideos has an error that pops up and says "Sorry, this video cannot be played" while the audio plays in the background and the samsung just has the same error, however when plugged into ddms the only output that may indicate an error is:
09-05 15:11:03.461: ERROR/QCvdec(95): Omx Flush issued when vdec is not initialized yet.
09-05 15:11:03.461: ERROR/QCvdec(95): Unsupported profile, level, or widht, height
09-05 15:11:03.461: ERROR/QCvdec(95): Unsupported clip
09-05 15:11:03.461: ERROR/QCvdec(95): Omx Flush issued when vdec is not initialized yet.
09-05 15:11:03.461: ERROR/QCvdec(95): Empty this buffer in Invalid State
09-05 15:11:03.461: ERROR/QCvdec(95): Omx Flush issued when vdec is not initialized yet.
I have encoded the videos in H264+AAC using the settings described here: http://developer.android.com/guide/appendix/media-formats.html and made sure the moov atoms are in the righ place with qt-fastart etc. See: http://www.sciencelearn.org.nz/content/download/7366/430467/version/14/file/08-future-of-radio-telescopes-sllg-ws.mp4
The videos play fine on 2.3.3, Motorola Xoom, Galaxy S, Galaxy Tab & HTC Desire. Any Ideas?