Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 77050

Unable to play saved videos from Isolated Storage on Android

$
0
0

Hi,

I am developing a cross platform application using Xamarin Forms which has the following requirements:-

  1. Download and save videos to phone storage for offline viewing.
  2. Saved video files should not be accessible outside the app.
  3. On App uninstall the saved files must be deleted.

Hence I used the cross-platform “lsolatedStorage” for saving and retrieving files. This seems to work fine on windows phone but on android, I am unable to play the saved videos from IsolatedStorage.

If I use Isolated Storage or System.Environment like – “Environment.GetFolderPath(Environment.SpecialFolder.Personal)”, the files get saved but when I play, the media player throws an error – “Can’t play this video”. However, if I use the android libraries – “Android.OS.Environment.ExternalStorageDirectory.AbsolutePath”, I am able to play the saved videos. I have tried third party media player apps (to check for format issue) but none of them were able to play from Isolated Storage.

The problem with the latter approach is that saved videos are accessible through the file manager on android (outside the app) and hence requirements 2 and 3 are not fulfilled.

Please let me know if this is a known issue and/or alternate approach to achieve the same. (I have attached a sample project for reference)

Regards,

Deepesh.


Viewing all articles
Browse latest Browse all 77050

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>