Baseflow / XamarinMediaManager

Cross platform Xamarin plugin to play and control Audio and Video
https://baseflow.com
MIT License
767 stars 305 forks source link

Xamarin Forms UWP Video not rendered #203

Closed dPritz closed 5 years ago

dPritz commented 7 years ago

I'm using Visual Studio 2015 with Xamarin.Forms 2.3.4.231 and using the MediaManager with a PCL. When I start to play a video on UWP only Audio is running. The VideoView element is visible but not the native canvas.

Xaml is mostly used like this:

`

    </Grid>

` Does somebody now about this issue? The VideoRenderer doesn't implement a Init method to call. Thanks.

jackd942 commented 7 years ago

Having the same issue with VS 2017 and Xamarin.Forms 2.3.4.247. No video, but audio is fine.

modplug commented 7 years ago

I've experienced the same problem on iOS when I didn't Init the VideoViewRenderer.

Try to initialize Xamarin.Forms like this in your UWP app

List assembliesToInclude = new List(); assembliesToInclude.Add(typeof(VideoViewRenderer).GetTypeInfo().Assembly); Xamarin.Forms.Forms.Init(e, assembliesToInclude);

Please report back :)

Steztric commented 7 years ago

Hi @modplug I also had the same problem in iOS. I just did new VideoViewRenderer(); in my Main.cs and it worked. Is there a better way? I couldn't work out how to do it by loading the assemblies manually like you did because the API is not the same in iOS.

pengx commented 7 years ago

UWP doesn't work even with @modplug 's suggestion. Video still not loading on UWP

naice commented 7 years ago

Same here with UWP. :/

JimSEOW commented 7 years ago

same here with UWP

Steztric commented 7 years ago

Have you tried using VideoViewRenderer.Init() in your initialisation code?

pengx commented 7 years ago

there is no VideoViewRenderer.Init() on UWP

managedcoder commented 7 years ago

I also have this same issue and to investigate I built the video example that James Montemagno created at https://github.com/jamesmontemagno/Hanselman.Forms and it has this same problem. I do think it's strange that the docs say must call VideoViewRenderer.Init() or else you will suffer the exact problem we are discussing here and yet, there is not VideoViewRenderer.Init() for UWP.... is that the solution we are looking for... someone needs to expose the Init() API? If James' code shows this same issue I think that's a pretty good indicator that this is a legit bug.

dPritz commented 7 years ago

The actual issue is that the size of the VideoRenderer was initialised with an ActualWidth and Height of 0. The video was loading and playing correctly but just not visible. Should be fixable by slightly adapting the renderer for UWP

einc commented 7 years ago

I'm having the same problem for Android. I've called VideoViewRenderer.Init() in my initialization code but I still only hear the audio. I tried setting HeightRequest="200" and WidthRequest="100" but I still cannot see the video. Is there something else I can try?

ThaineNorris commented 7 years ago

I have the same problem with UWP and Android. No video is displayed, though its audio is played. I tried forcing window size in the UWP VideoViewRenderer. but that didn't help either.

Onjay commented 7 years ago

I am having the same issue. The video will not render, but audio will play. I'm using 0.4.3, Plug.MediaManger.Forms, and Plugin.MediaManager. I've set a height and width in XAML for the control, with no effect. I've set UWP's App.xaml.cs to typeof(VideoViewRenderer).GetTypeInfo().Assembly, and/or Mainpage's new VideoViewRenderer(); with no effect.

johnthiriet commented 7 years ago

I can confirm the same issue. I can't even debug the sample project since because of bait and switch I can't put a breakpoint inside the VideoViewRenderer class for UWP.

jlmacedo commented 6 years ago

I have the same problem with the call "VideoViewRenderer.Init();" in MainPage.xaml.cs UWP, there is no VideoViewRenderer.Init() on UWP. Version: 0.4.5

GovardhanNag commented 6 years ago

Add below code in App.xaml.cs for UWP, which resolved my video rendering issue.

var assemblies = new List(); assemblies.Add(typeof(VideoViewRenderer).GetTypeInfo().Assembly); Xamarin.Forms.Forms.Init(e, assemblies);

CliffAgius commented 6 years ago

@GovardhanNag I have tried this but still no Init() and it's not working. Are you using Forms or Xamarin.UWP

martijn00 commented 5 years ago

Fixed in 0.6.5