Baseflow / ExoPlayerXamarin

Xamarin bindings library for the Google ExoPlayer library
https://baseflow.com
MIT License
153 stars 67 forks source link

Play local mp4 files #71

Closed andreabonassi closed 6 years ago

andreabonassi commented 6 years ago

Good morning, i have problem with the last nuget package version.

    Android.Net.Uri dashUri = Android.Net.Uri.Parse("http://www-itec.uni-klu.ac.at/ftp/datasets/DASHDataset2014/BigBuckBunny/15sec/BigBuckBunny_15s_simple_2014_05_09.mpd");
    Android.Net.Uri httpUri = Android.Net.Uri.Parse("http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4");
    Android.Net.Uri fileUri = Android.Net.Uri.FromFile(new File("/mnt/am_sd2/VideoPubblicitari/Vendita.mp4"));

    //1 WORK OK
    //DashMediaSource mediaSource = new DashMediaSource(dashUri, dataSourceFactory, new DefaultDashChunkSource.Factory(dataSourceFactory), null, null);
    //2 WORK OK
    //IMediaSource mediaSource = new ExtractorMediaSource(httpUri, dataSourceHttpFactory, new DefaultExtractorsFactory(), null, null);
    //3 NOT WORK
    IMediaSource mediaSource = new ExtractorMediaSource(fileUri, dataSourceHttpFactory, new DefaultExtractorsFactory(), null, null);

The first two points are working properly, I can not find a solution in order to display a mp4 video taken from local storage.

Can you help me?

martijn00 commented 6 years ago

This works the same as it would in Exoplayer native. Look at their samples or post the question on Stackoverflow to find the answer.