Git Product home page Git Product logo

vlc.mediaelement's Introduction

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

  • How to play a file using a FileOpenPicker ?
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 :

  • DeinterlaceMode : the deinterlace mode (Bob, Mean, Linear, X, Yadif, Yadif2x, ...) - only works if HardwareAcceleration is set to false.
  • HardwareAcceleration : a value indicating whether the hardware acceleration must be used or not.
  • Options : a dictionary to add some options to the media (see VLC command-line help). This property must be defined before setting the source.

On VLC.MediaTransportControls :

  • AutoHide : indicates whether the media transport controls must be hidden automatically or not.
  • AvailableDeinterlaceModes : the deinterlace modes to show in the deinterlace menu.
  • Content : you can add some content over the video.
  • CursorAutoHide : indicates whether the mouse cursor must be hidden automatically or not.
  • IsDeinterlaceModeButtonEnabled : indicates whether the user can choose a deinterlace mode.
  • IsDeinterlaceModeButtonVisible : indicates whether the deinterlace mode button must be shown or not.

Download

Windows Runtime Component : NuGet

Class Library : NuGet

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.