Skip to content
This repository has been archived by the owner on Nov 3, 2022. It is now read-only.

Black screen for certain video files #83

Open
habim84 opened this issue Jul 22, 2019 · 0 comments
Open

Black screen for certain video files #83

habim84 opened this issue Jul 22, 2019 · 0 comments

Comments

@habim84
Copy link

habim84 commented Jul 22, 2019

This is the XAML for the vlc:MediaElement:
<StackPanel> <vlc:MediaElement x:Name="mediaPlayer" AreTransportControlsEnabled="True" HardwareAcceleration="False" Height="1000"/> </StackPanel>
This is the C# code to load the media source onto the MediaElement:

public sealed partial class Player : Page
    {
        private const string FILE_TOKEN = "{SOME GUID}";
        public Player()
        {
            this.InitializeComponent();
            if (!App.setOptions)
            {
                //mediaPlayer.Options.Add("glconv", "direct3d9");
                App.setOptions = true;
            }
        }

        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            base.OnNavigatedTo(e);
            Episode s = (Episode)e.Parameter;
            StorageFile file = s.episodeFile;
            if (file != null)
            {
                StorageApplicationPermissions.FutureAccessList.AddOrReplace(FILE_TOKEN, file);
                mediaPlayer.Source = null;
                mediaPlayer.Source = $"winrt://{FILE_TOKEN}";
            }

        }

        protected override void OnNavigatingFrom(NavigatingCancelEventArgs e)
        {
            mediaPlayer.Stop();
        }
}

Somehow for some video files, it works normally but for some files I only get the audio working but the video output is just a black screen. I did try setting the HardwareAcceleration attribute to 'true' but nothing changed.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant