kakone / VLC.MediaElement

MediaElement clone powered by VLC
GNU Lesser General Public License v2.1
68 stars 33 forks source link

:warning: This repository is no longer updated, use LibVLCSharp instead.

VLC.MediaElement for UWP

MediaElement clone powered by VLC.

It's just a little control, all the hard work is done by VLC. So, thanks to the VLC team !

Usage

Requires Windows 10 Anniversary Edition and matching Windows SDK.

Add the NuGet package to your project and use it as the classic MediaElement (don't forget the Internet (Client) capability for this sample code) :

xmlns:vlc="using:VLC"
<vlc:MediaElement AreTransportControlsEnabled="True" HardwareAcceleration="True"
                  Source="http://download.blender.org/peach/bigbuckbunny_movies/big_buck_bunny_480p_surround-fix.avi">
    <vlc:MediaElement.TransportControls>
        <vlc:MediaTransportControls ControlPanelOpacity="0.8" />
    </vlc:MediaElement.TransportControls>
</vlc:MediaElement>

VLC.MediaElement screenshot

How To

private const string FILE_TOKEN = "{1BBC4B94-BE33-4D79-A0CB-E5C6CDB9D107}"; // GUID in registry format
var fileOpenPicker = new FileOpenPicker();
fileOpenPicker.FileTypeFilter.Add("*");
var file = await fileOpenPicker.PickSingleFileAsync();
if (file != null)
{
    StorageApplicationPermissions.FutureAccessList.AddOrReplace(FILE_TOKEN, file);
    mediaElement.Source = null;
    mediaElement.Source = $"winrt://{FILE_TOKEN}";
}

Added properties

There are some added properties compared to the classic MediaElement :

On VLC.MediaTransportControls :

Download

Windows Runtime Component : NuGet

Class Library : NuGet