Play local file with MedaiManager

DaveAuDaveAu AUMember ✭✭

Hi, I'm trying to play a video stored locally using MedaiManager. Do I need to put it in the PCL project or in the iOS > Resources folder? And is this set to Content or Embedded in the properties of the file?

I took a look through the samples but couldn't see anything specific to playing a local video file:

https://forums.xamarin.com/discussion/94847/play-video-pcl-project

Any suggestions? TIA

Answers

  • DaveAuDaveAu AUMember ✭✭
    edited May 2017
    `<forms:VideoView Grid.Row="0" Grid.RowSpan="1" HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand"
                         Source="MediaFile.mp4" AspectMode="AspectFill"/>'`
    
  • DaveAuDaveAu AUMember ✭✭
    edited May 2017

    Ended up using the custom renderers... Didn't really want to as I thought the MediaManager would be able to play local media files. I'm sure it might be able to but I couldn't find it.
    Here's the link to creating a video player. I added a few more events to stop/pause/resume the video

  • jonathannicholsjonathannichols USMember ✭✭

    I am in the same boat, I may have to use custom renderers as there is NO documentation on playing local videos

  • dudueduxdddudueduxdd Member ✭✭

    @jonathannichols said:
    I am in the same boat, I may have to use custom renderers as there is NO documentation on playing local videos

    Same boat too =[, I need to download video, save them and play offline when the user have no internet connection,

    Did someone do that?

  • parzivalmxparzivalmx Member ✭✭

    Hi, i was able to do this:

    var folder = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData);
    folder = Path.Combine(folder, "yourfolder/yourvideo.mp4");
    videoPlayer.Source = VideoSource.FromFile(folder);
    
  • marcelovargasmarcelovargas USMember ✭✭
    Help me please.
    Do you have the solution?
  • parzivalmxparzivalmx Member ✭✭

    @marcelovargas said:
    Help me please.
    Do you have the solution?

    Yes, see my answer.

Sign In or Register to comment.