-4

In my android app, I cannot play mov file format video file in with intent and it shows (Failed to play video) in app and in logcat, it shows Exception occurred:

java.lang.IllegalArgumentException: Unknown URI for .mov file format

Ali
  • 3,373
  • 5
  • 42
  • 54
jerry
  • 45
  • 12
  • post your code here – Lakhwinder Singh Jun 29 '17 at 07:00
  • Intent videoIntent = new Intent(Intent.ACTION_VIEW); videoIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); videoIntent.setDataAndType(Uri.parse(finalToLoad), "video/*"); context.startActivity(videoIntent); – jerry Jun 29 '17 at 07:01
  • The `mov` file format is not supported by Android (well, you know, it's an **Apple** media format). https://developer.android.com/guide/topics/media/media-formats.html – Phantômaxx Jun 29 '17 at 07:29

2 Answers2

0
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(videoPath));
intent.setDataAndType(Uri.parse(videoPath), "video/*");
startActivity(intent);

Please make sure , your path is correct

Lakhwinder Singh
  • 6,799
  • 4
  • 25
  • 42
  • yes, my path is correct , i can play .mp4 file except .mov file. Is there any other way to play .mov format file using intent? – jerry Jun 29 '17 at 07:14
  • Then i think your device does not contain any application that will play .mov format – Lakhwinder Singh Jun 29 '17 at 07:15
  • yes, my device is samsung s6 edge , android 7+. Some suggested me to transcode .mov to .mp4 . but i can't find any code or library to .mov url to .mp4 url in android studio. – jerry Jun 29 '17 at 07:19
0

First get .mov (quick time) file from intent

Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(videoPath));
intent.setDataAndType(Uri.parse(videoPath), "video/*");
startActivity(intent);

and use

implementation 'com.devbrackets.android:exomedia:4.3.0'

instead of Default VideoView of Android. Method of using this videoview is same like default android videoview.

Salman Khalid
  • 543
  • 5
  • 23