9

Has anyone been able to successfully play a video using Android Things on a Raspberry Pi? If so was there anything special you had to do to get it to work? If not does any one know why it isn't working?

I made a simple video player that plays a local video from disk. The app runs fine on a phone but I get an error dialog on the Pi saying "Can't play this video".

One Thing I have already ran into but I think I solved was there are no content providers in Android Things, so instead of using a uri for the video source I gave it a file directly like so.

EDIT: Code edit

VideoView videoPanel;
.
.
.
videoPanel.SetVideoURI(Android.Net.Uri.FromFile(new Java.IO.File("/sdcard/Movies/videoFile.mp4")));
Omar Rodriguez
  • 429
  • 5
  • 13

3 Answers3

2

I was using 0.5.1-devpreview with raspberry pi 3, and tried to use exoplayer to play mp4. Audio works but not video (just black screen). Same result for youtube iframe sdk (black screen with only audio playing).

yawl
  • 719
  • 6
  • 7
0

I was able to get it to work for my project using setVideoPath instead of SetVideoURI. So your code would be

File file = new Java.IO.File("/sdcard/Movies/videoFile.mp4");
videoPanel.setVideoPath(file.getAbsolutePath());
Chris Stillwell
  • 10,266
  • 10
  • 67
  • 77
0

Try adding this

android:hardwareAccelerated="true"

to your activity in the manifest.

Aleks Andreev
  • 7,016
  • 8
  • 29
  • 37
Samuel Grogan
  • 1,009
  • 10
  • 18