adamfisher / Xamarin.Forms.VideoPlayer

A Xamarin Forms control to render the native video player on every platform.
MIT License
147 stars 71 forks source link

Error XAML (YouTubeVideo): The value can't be null #75

Closed JohanVillanueva closed 6 years ago

JohanVillanueva commented 6 years ago

I have an error trying to use YouTube video as Source. I created the MarkupExtensions folder that contains the files: HttpUtility.cs and YouTubeVideoIdExtension.cs (seen in github repo), but I have the following error:

The value can't be null name of the parameter: clrNamespace

I tried a normal video (https: //..mp4) and it worked. But with a Youtube video that error comes out. Please help.

Code XAML

<ContentPage
    x:Class="ProjectFenix.Views.InfoLugar.Videos.VideoViewerPage"
    xmlns="http://xamarin.com/schemas/2014/forms"
    xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
    xmlns:me="clr-namespace:ProjectFenix.MarkupExtensions;assembly=ProjectFenix"
    xmlns:o="clr-namespace:Octane.Xam.VideoPlayer;assembly=Octane.Xam.VideoPlayer"
    BackgroundColor="Black">
    <o:VideoPlayer Source="{e:YouTubeId irQ1NhpPoJs}" />
</ContentPage>
adamfisher commented 6 years ago

It's hard to tell where the problem is occurring without a stack trace but you should be able to step through the markup extension with the Visual Studio debugger since it is included in your project.

Keep in mind that extension is merely provided for demo purposes and is not officially supported by YouTube since it just scrapes their pages. You will want to use the YouTube API to get video URLs to pass into your player for a production application.