-
Hi, thank you for all your support. What I want to achieveI am currently extending FlyleafPlayer (WPF Control) (WPF) to create a video player. FlyleafPlayer uses Subtitles and other WPF elements are displayed on top of the video as overlay using data binding. I would like to add a sidebar to this sample app like I would like this sidebar to appear outside of the video like above, not overlaid on it. However, I want it to appear in the same window, not in a separate window. QuestionTo display the sidebar outside the video as above, instead of initializing Sample code is provided below with reference to FlyleafMultiPlayer. MainWindow.xaml <Window x:Class="SamplePlayer.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:SamplePlayer"
xmlns:fl="clr-namespace:FlyleafLib.Controls.WPF;assembly=FlyleafLib"
xmlns:flwpf="clr-namespace:FlyleafLib.Controls.WPF;assembly=FlyleafLib.Controls.WPF"
mc:Ignorable="d"
Title="SamplePlayer" Height="450" Width="800"
d:DataContext="{d:DesignInstance local:MainWindow}">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<flwpf:FlyleafME
Grid.Column="0"
x:Name="FlyleafME"
Player="{Binding Player, Mode=TwoWay}">
<!-- NOTE: I want to display this element on top of the video. But it is not displayed. -->
<TextBlock
Margin="50 100 0 0"
FontSize="30"
Text="Hello Flyleaf Overlay! (e.g. Subtitle)"
Foreground="Aquamarine"/>
</flwpf:FlyleafME>
<!-- Sidebar -->
<StackPanel Grid.Column="1">
<TextBlock Text="Sidebar" FontSize="20" Background="DarkGray" />
<ListView Width="200"
FontSize="20">
<ListViewItem>
aaaaaaaaaaaaaa
</ListViewItem>
<ListViewItem>
bbbbbbbbbbbbbb
</ListViewItem>
<ListViewItem>
ccccccccccccccc
</ListViewItem>
</ListView>
</StackPanel>
</Grid>
</Window> MainWindow.xaml.cs (code-behind) using FlyleafLib;
using FlyleafLib.Controls.WPF;
using FlyleafLib.MediaPlayer;
using System.ComponentModel;
using System.IO;
using System.Windows;
namespace SamplePlayer;
public partial class MainWindow : Window
{
public Player Player { get; set; }
public MainWindow()
{
Engine.Start(new EngineConfig()
{
#if DEBUG
LogOutput = ":debug",
LogLevel = LogLevel.Debug,
FFmpegLogLevel = FFmpegLogLevel.Warning,
#endif
PluginsPath = ":Plugins",
FFmpegPath = ":FFmpeg",
});
Config config = new();
Player = new Player(config);
DataContext = this;
InitializeComponent();
Closing += (o, e) =>
{
while (Engine.Players.Count > 0)
{
Engine.Players[0].Dispose();
}
};
}
} I want to put a WPF element on top of a video, but the It showed up if I used <!-- NOTE: Changed from FlyleafMe -->
<fl:FlyleafHost
Grid.Column="0"
x:Name="FlyleafME"
Player="{Binding Player, Mode=TwoWay}">
<!-- NOTE: This element is displayed -->
<TextBlock
Margin="50 100 0 0"
FontSize="30"
Text="Hello Flyleaf Overlay! (e.g. Subtitle)"
Foreground="Aquamarine"/>
</fl:FlyleafHost> The overlay is displayed as follows. So my question is Also, could you please let me know if there are any good ways to achieve the above requirements? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 5 replies
-
Hi @umlx5h, this is tricky indeed. |
Beta Was this translation helpful? Give feedback.
-
Hey @umlx5h, check the FlyleafMEwithSideBar sample that I've included there (just change App.xaml startupuri to FlyleafMEwithSideBar.xaml) I misunderstood your requirement, hope now it's what you want. |
Beta Was this translation helpful? Give feedback.
-
I'm really confused, that can be simple achieved with this then? <Window x:Class="WpfFlyleafHost.FlyleafMEwithSideBar"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:WpfFlyleafHost"
xmlns:fl="clr-namespace:FlyleafLib.Controls.WPF;assembly=FlyleafLib" xmlns:fl1="clr-namespace:FlyleafLib.MediaPlayer;assembly=FlyleafLib"
xmlns:flwpf="clr-namespace:FlyleafLib.Controls.WPF;assembly=FlyleafLib.Controls.WPF"
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
mc:Ignorable="d"
Title="FlyleafMEwithSideBar" Height="450" Width="800">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<flwpf:FlyleafME Player="{Binding Player}"/>
<!--Playlist SideBar-->
<StackPanel Grid.Column="1" >
<TextBlock Text="Sidebar" FontSize="20" Background="DarkGray" />
<ListView Width="200" FontSize="20">
<ListViewItem>
aaaaaaaaaaaaaa
</ListViewItem>
<ListViewItem>
bbbbbbbbbbbbbb
</ListViewItem>
<ListViewItem>
ccccccccccccccc
</ListViewItem>
</ListView>
</StackPanel>
</Grid>
</Window> |
Beta Was this translation helpful? Give feedback.
Hey @umlx5h, check the FlyleafMEwithSideBar sample that I've included there (just change App.xaml startupuri to FlyleafMEwithSideBar.xaml)
I misunderstood your requirement, hope now it's what you want.
(I'm afraid that you might have issues with the keybindings)