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

Wpf VlcControl seems to ignore ZIndex #41

Closed
nextdracool opened this issue Apr 13, 2015 · 6 comments
Closed

Wpf VlcControl seems to ignore ZIndex #41

nextdracool opened this issue Apr 13, 2015 · 6 comments

Comments

@nextdracool
Copy link

I tried to draw a semi-transparent overlay (Grid + Semi-Transparent Rectangle) over the vlc control and it is invisible.
I then tried to show it partly over the vlc control and partly over the form and it was visible over the form, but invisible over the VlcControl.

Markup Code:

<Window
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:Wpf="clr-namespace:Vlc.DotNet.Wpf;assembly=Vlc.DotNet.Wpf" x:Class="LivestreamViewer.MainWindow"
        Title="MainWindow" Height="449" Width="753">
    <Grid>
        <Wpf:VlcControl x:Name="vlc" Margin="0,0,0,13" Panel.ZIndex="-1"/>
        <Grid x:Name="overlayGrid" HorizontalAlignment="Stretch" Height="25" Margin="0,0,0,0" VerticalAlignment="Bottom" Panel.ZIndex="1">
            <Rectangle Fill="Black" HorizontalAlignment="Stretch" Margin="0,0,0,0" Stroke="Black" VerticalAlignment="Stretch" IsHitTestVisible="False" Opacity="0.5"/>
        </Grid>
    </Grid>
</Window>

Screenshot of the result:
ae12c35861

@nextdracool
Copy link
Author

Checking the source code and WPF Interop problems reveals that this happens because the WPF VlcControl is just a HwndHost displaying the WinForms VlcControl. Rules for when problems occur can be found here
At the moment there does not seem to be a fix available.

A possible workaround would be to use the video_set_callbacks function from libvlc and some kind of custom rendering method. The nVLC project seems to have such a custom renderer using a D3DImage surface. Sadly it looks abandoned.

@wuzhenda
Copy link

yes,that's helpful

@kjeremy
Copy link

kjeremy commented Oct 6, 2015

Any general guidance on how to create a pure wpf control with vlc? I can take a stab at it...

@kjeremy
Copy link

kjeremy commented Oct 6, 2015

Specifically: how does the rendering happen and where would I use the video_set_callbacks (as an alternative to an existing call?) to alter the behavior?

@wuzhenda
Copy link

wuzhenda commented Oct 8, 2015

see this issue:
#12
and reference the repo:
https://github.com/higankanshi/xZune.Vlc

@jeremyVignelles
Copy link
Collaborator

Thanks for the great bug report, I've just created an issue to gather all issues related to this : #296

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

4 participants