Example #1
0
 private async void VLCService_MediaListItemAdded(libVLCX.Media media, int index)
 {
     await DispatchHelper.InvokeInUIThread(CoreDispatcherPriority.Normal, async() =>
     {
         var localNetwork = new VLCFileExplorerViewModel(media, RootFolderType.Network);
         await AddToFolder(localNetwork);
     });
 }
Example #2
0
        private void OpenMediaFile(StorageFile mediaFile)
        {
            string path = $"winrt://{StorageApplicationPermissions.FutureAccessList.Add(mediaFile)}";

            libVLCX.Media media = new libVLCX.Media(vlcInstance, path, libVLCX.FromType.FromPath);

            vlcMediaPlayer?.stop();
            vlcMediaPlayer = new libVLCX.MediaPlayer(media);
            vlcMediaPlayer.eventManager().OnPositionChanged += (s) => Debug.WriteLine($"{Position.ToString()} / {Duration.ToString()}");
            vlcMediaPlayer.setAudioOutput(audioDeviceId);
            vlcMediaPlayer.play();
        }
 private async void VLCService_MediaListItemAdded(libVLCX.Media media, int index)
 {
     try
     {
         await DispatchHelper.InvokeAsync(CoreDispatcherPriority.Normal, async() =>
         {
             var localNetwork = new VLCFileExplorerViewModel(media, RootFolderType.Network);
             await AddToFolder(localNetwork);
         });
     }
     catch (Exception e)
     {
         Debug.WriteLine(e);
     }
 }
        private async void VLCService_MediaListItemDeleted(libVLCX.Media media, int index)
        {
            var fileExType = FileExplorersGrouped.FirstOrDefault(x => (RootFolderType)x.Key == RootFolderType.Network);

            if (fileExType == null)
            {
                return;
            }
            var fileEx = fileExType.FirstOrDefault(x => x.Name == media.meta(libVLCX.MediaMeta.Title));

            if (fileEx == null)
            {
                return;
            }
            await DispatchHelper.InvokeAsync(CoreDispatcherPriority.Normal, () => fileExType.Remove(fileEx));
        }