Skip to content
This repository has been archived by the owner on Nov 8, 2019. It is now read-only.

Local video #172

Open
CarlosEMF2 opened this issue Jul 13, 2019 · 3 comments
Open

Local video #172

CarlosEMF2 opened this issue Jul 13, 2019 · 3 comments

Comments

@CarlosEMF2
Copy link

could you help me?

How to use a local video?

something like that:

            <video: VideoPlayer.Source>
                <video: ResourceVideoSource>
                    <video: ResourceVideoSource.Path>
                        <OnPlatform
                            x: TypeArguments = "x: String"
                            iOS = "Videos / video.mp4"
                            Android = "video.mp4">
                        </ OnPlatform>
                    </video:ResourceVideoSource.Path>
                </ video: ResourceVideoSource>
            </video:VideoPlayer.Source>
@DPY81
Copy link

DPY81 commented Aug 8, 2019

This is how I do it …

In c# ….

Video_Background.Source = VideoSource.FromResource(
                "MobileApp.Images.video.video_sutf_intro.mp4",
                typeof(OwnProfilePage).GetTypeInfo().Assembly);

with the variable set in XAML:

<video:VideoPlayer 
                x:Name="Video_Background"
                AutoPlay="True"
                DisplayControls="False"
                Repeat="True"
                BackgroundColor="Black"
                AbsoluteLayout.LayoutBounds="0, 0, 1, 1"
                AbsoluteLayout.LayoutFlags="All"
                Margin="0"
                IsVisible="False"/>

@CarlosEMF2
Copy link
Author

Thanks, I will try it

@DanWBR
Copy link

DanWBR commented Sep 10, 2019

It works on iOS if you set the relative path of the video file, but not on Android. Currently the only way to play local files with a single codebase is to add your videos as embedded resources on your shared project and set the source as something like the following:

VideoPlayer.Source = VideoSource.FromResource("Videos.particles.mp4");

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants