Commit d5703803 authored by Martin Finkel's avatar Martin Finkel

samples: update to new simpler Uri API

parent f59c7c3c
using System.ComponentModel;
using System;
using System.ComponentModel;
using LibVLCSharp.Shared;
namespace LibVLCSharp.Forms.Sample.MediaPlayerElement
......@@ -49,9 +50,7 @@ namespace LibVLCSharp.Forms.Sample.MediaPlayerElement
LibVLC = new LibVLC();
var media = new Media(LibVLC,
"http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4",
FromType.FromLocation);
var media = new Media(LibVLC, new Uri("http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4"));
MediaPlayer = new MediaPlayer(media) { EnableHardwareDecoding = true };
MediaPlayer.Play();
......
......@@ -42,9 +42,7 @@ namespace LibVLCSharp.Forms.Sample
LibVLC = new LibVLC();
MediaPlayer = new MediaPlayer(LibVLC)
{
Media = new Media(LibVLC,
"http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4",
FromType.FromLocation)
Media = new Media(LibVLC, new Uri("http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4"))
};
}
......
......@@ -3,6 +3,7 @@ using Android.OS;
using Android.Views;
using Android.Widget;
using LibVLCSharp.Shared;
using System;
using VideoView = LibVLCSharp.Platforms.Android.VideoView;
namespace LibVLCSharp.Android.Sample
......@@ -19,7 +20,7 @@ namespace LibVLCSharp.Android.Sample
base.OnCreate(savedInstanceState);
// Set our view from the "main" layout resource
SetContentView(Resource.Layout.Main);
SetContentView(Resource.Layout.Main);
}
protected override void OnResume()
......@@ -36,7 +37,7 @@ namespace LibVLCSharp.Android.Sample
_videoView = new VideoView(this) { MediaPlayer = _mediaPlayer };
AddContentView(_videoView, new LinearLayout.LayoutParams(ViewGroup.LayoutParams.WrapContent, ViewGroup.LayoutParams.WrapContent));
var media = new Media(_libVLC, "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4", FromType.FromLocation);
var media = new Media(_libVLC, new Uri("http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4"));
_videoView.MediaPlayer.Play(media);
}
......
......@@ -7,6 +7,6 @@ let main argv =
Core.Initialize()
let libVLC = new LibVLC()
let mp = new MediaPlayer(libVLC)
mp.Play(new Media(libVLC, "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4", FromType.FromLocation)) |> ignore
mp.Play(new Media(libVLC, new Uri("http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4"))) |> ignore
let result = Console.ReadKey()
0
using Gtk;
using LibVLCSharp.Shared;
using System;
namespace LibVLCSharp.GTK.Sample
{
......@@ -28,8 +29,7 @@ namespace LibVLCSharp.GTK.Sample
//Starts playing
using var media = new Media(libvlc,
"http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4",
FromType.FromLocation);
new Uri("http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4"));
mediaPlayer.Play(media);
......
......@@ -31,7 +31,7 @@ namespace LibVLCSharp.Mac.Sample
View = _videoView;
_videoView.MediaPlayer.Play(new Media(_libVLC, "https://download.blender.org/peach/bigbuckbunny_movies/BigBuckBunny_320x180.mp4", FromType.FromLocation));
_videoView.MediaPlayer.Play(new Media(_libVLC, new Uri("https://download.blender.org/peach/bigbuckbunny_movies/BigBuckBunny_320x180.mp4")));
}
public override NSObject RepresentedObject
......
......@@ -10,7 +10,7 @@ namespace LibVLCSharp.NetCore.Sample
Core.Initialize();
using var libVLC = new LibVLC();
using var media = new Media(libVLC, "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ElephantsDream.mp4", FromType.FromLocation);
using var media = new Media(libVLC, new Uri("http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ElephantsDream.mp4"));
using var mp = new MediaPlayer(media);
mp.Play();
Console.ReadKey();
......
......@@ -62,8 +62,8 @@ namespace LibVLCSharp.UWP.Sample
{
LibVLC = new LibVLC(eventArgs.SwapChainOptions);
MediaPlayer = new MediaPlayer(LibVLC);
MediaPlayer.Play(new Media(LibVLC, "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4",
FromType.FromLocation));
MediaPlayer.Play(new Media(LibVLC,
new Uri("http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4")));
}
/// <summary>
......
......@@ -32,7 +32,7 @@ namespace LibVLCSharp.WPF.Sample
// we need the VideoView to be fully loaded before setting a MediaPlayer on it.
VideoView.Loaded += (sender, e) => VideoView.MediaPlayer = _mediaPlayer;
}
void StopButton_Click(object sender, RoutedEventArgs e)
{
if (VideoView.MediaPlayer.IsPlaying)
......@@ -46,7 +46,7 @@ namespace LibVLCSharp.WPF.Sample
if (!VideoView.MediaPlayer.IsPlaying)
{
VideoView.MediaPlayer.Play(new Media(_libVLC,
"http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4", FromType.FromLocation));
new Uri("http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4")));
}
}
......
......@@ -25,7 +25,7 @@ namespace LibVLCSharp.WinForms.Sample
private void Form1_Load(object sender, EventArgs e)
{
_mp.Play(new Media(_libVLC, "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4", FromType.FromLocation));
_mp.Play(new Media(_libVLC, new Uri("http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4")));
}
}
}
......@@ -10,7 +10,7 @@ namespace LibVLCSharp.Windows.Net40.Sample
Core.Initialize();
using var libVLC = new LibVLC();
using var media = new Media(libVLC, "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4", FromType.FromLocation);
using var media = new Media(libVLC, new Uri("http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4"));
using var mp = new MediaPlayer(media);
mp.Play();
......
......@@ -22,7 +22,7 @@ namespace LibVLCSharp.iOS.Sample
View = _videoView;
_videoView.MediaPlayer.Play(new Media(_libVLC, "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4", FromType.FromLocation));
_videoView.MediaPlayer.Play(new Media(_libVLC, new Uri("http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4")));
}
}
}
using LibVLCSharp.Platforms.tvOS;
using LibVLCSharp.Shared;
using System;
using UIKit;
namespace LibVLCSharp.tvOS.Sample
......@@ -22,7 +22,7 @@ namespace LibVLCSharp.tvOS.Sample
View = _videoView;
_videoView.MediaPlayer.Play(new Media(_libVLC, "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4", FromType.FromLocation));
_videoView.MediaPlayer.Play(new Media(_libVLC, new Uri("http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4")));
}
}
}
......@@ -61,8 +61,8 @@ namespace LibVLCSharp.Uno.Sample
{
LibVLC = new LibVLC(swapChainOptions);
MediaPlayer = new Shared.MediaPlayer(LibVLC);
MediaPlayer.Play(new Media(LibVLC, "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4",
FromType.FromLocation));
MediaPlayer.Play(new Media(LibVLC,
new Uri("http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4")));
}
/// <summary>
......
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