2

Not sure what to do from here. My mp4.video works on most devices but the emulator I gives me this error msg from logcat:

03-28 09:42:36.745 21332-21332/com.m D/MediaPlayer: getMetadata
03-28 09:42:36.766 21332-21346/com.m E/MediaPlayer: error (1, -38)
03-28 09:42:36.768 21332-21347/com.m E/MediaPlayer: error (1, -38)
03-28 09:42:36.810 21332-21332/com.m E/MediaPlayer: Error (1,-38)
03-28 09:42:36.810 21332-21332/com.m D/VideoView: Error: 1,-38

I also have an old API 15 device which gives me the following error:

03-28 10:09:04.174 12122-12122/com.m E/MediaPlayer: Error (1,-22)
03-28 10:09:04.174 12122-12122/com.m D/VideoView: Error: 1,-22

code:

getWindow().setFormat(PixelFormat.UNKNOWN);

        mVideoView = (VideoView)findViewById(R.id.account_upsell_video);
        if ( mVideoView != null ) {
            mVideoView.setOnPreparedListener(new MediaPlayer.OnPreparedListener() {
                @Override
                public void onPrepared(final MediaPlayer mp) {
                    mIsVideoPrepared = true;
                    mp.setLooping(true);
                    mp.start();
                }
            });

            final MediaController ctrl = new MediaController(getContext());
            ctrl.setVisibility(View.GONE);
            mVideoView.setMediaController(ctrl);

            final String url = String.format(Locale.getDefault(), "android.resource://%s/%d", getPackageName(), R.raw.intro);
            mVideoView.setVideoURI( Uri.parse( url ) );

Some specific advice what to do from here with my code would be <3 Regards

Jesper Martensson
  • 1,238
  • 3
  • 18
  • 44

0 Answers0