1

I have few tutorial screens in my app, and on some Samsung device, I get this error when trying to play it:

Can't play this video

The said video is in the app's package, and not on some external source like SD card, so I don't know whats the problem... The video is in .mp4 format, here is how I play it

    vvTutorial = (VideoView) v.findViewById(R.id.vvTutorial);
    Uri myUri = Uri.parse("android.resource://" + getActivity().getPackageName() + "/" + R.raw.video_tut_4);
    vvTutorial.setMediaController(null);
    vvTutorial.setVideoURI(myUri);
    vvTutorial.start();
    vvTutorial.setOnPreparedListener(new OnPreparedListener() {

        @Override
        public void onPrepared(MediaPlayer mp) {
            mp.setLooping(true);
        }
    });

Whats wrong, why is it giving this error only on this device, but not on the others I've tested?

Sartheris Stormhammer
  • 2,534
  • 8
  • 37
  • 81
  • I dont know much about videoview but it seems odd to start something if it is not prepared allready! The documentation from Google also doesnt say anything about the start() method lol – Ilja KO Jun 27 '15 at 15:03
  • Can you play the video outside of your application via the phone's video player? *mp4* is a container format and your phone may not be able to play all supported video formats that are allowed inside that container. – dhke Jun 27 '15 at 15:17
  • yes, the video is played just fine otherwise – Sartheris Stormhammer Jun 27 '15 at 17:45

1 Answers1

1

android generally supports video of particular encoding only..and that too is dependent on device. It is better that you try with 3gp format And you can change the video format using VLC media palyer

AndroidEngineX
  • 975
  • 1
  • 9
  • 22