Commit af7fed56 authored by Martin Finkel's avatar Martin Finkel

Update and fix chromecast sample

parent 0a415632
......@@ -52,7 +52,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="LibVLCSharp">
<Version>0.1.4</Version>
<Version>0.2.0</Version>
</PackageReference>
<PackageReference Include="VideoLAN.LibVLC.Android">
<Version>3.0.0</Version>
......
......@@ -151,7 +151,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="LibVLCSharp">
<Version>0.1.4</Version>
<Version>0.2.0</Version>
</PackageReference>
<PackageReference Include="VideoLAN.LibVLC.iOS">
<Version>3.1.5-alpha</Version>
......
......@@ -5,7 +5,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="LibVLCSharp" Version="0.1.4" />
<PackageReference Include="LibVLCSharp" Version="0.2.0" />
<PackageReference Include="Xamarin.Forms" Version="3.3.0.967583" />
</ItemGroup>
</Project>
\ No newline at end of file
......@@ -7,6 +7,7 @@ using static System.Diagnostics.Debug;
using Xamarin.Forms;
using System;
using Xamarin.Forms.PlatformConfiguration;
namespace Chromecast
{
......@@ -71,9 +72,19 @@ namespace Chromecast
// create core libvlc object
_libVLC = new LibVLC();
// choose the correct service discovery protocol depending on the host platform
// Apple platforms use the Bonjour protocol
RendererDescription renderer;
if (Device.RuntimePlatform == Device.iOS)
renderer = _libVLC.RendererList.FirstOrDefault(r => r.Name.Equals("Bonjour_renderer"));
else if (Device.RuntimePlatform == Device.Android)
renderer = _libVLC.RendererList.FirstOrDefault(r => r.Name.Equals("microdns_renderer"));
else throw new PlatformNotSupportedException("Only Android and iOS are currently supported in this sample");
// create a renderer discoverer
_rendererDiscoverer = new RendererDiscoverer(_libVLC);
_rendererDiscoverer = new RendererDiscoverer(_libVLC, renderer.Name);
// register callback when a new renderer is found
_rendererDiscoverer.ItemAdded += RendererDiscoverer_ItemAdded;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment