unosquare / ffmediaelement

FFME: The Advanced WPF MediaElement (based on FFmpeg)
https://unosquare.github.io/ffmediaelement/
Other
1.17k stars 241 forks source link

Then tow instance,FfmediaElement non't work #649

Open kuangxj opened 1 year ago

kuangxj commented 1 year ago

Issue Title (change this title!)

Please enter a general description for the issue. Delete sections that are not relevant and provide additional sections if necessary.

Issue Categories

Version Information

Steps to Reproduce

  1. Step 1

  2. Step 2

  3. Step 3

Expected Results

Sample Code

XAML

<UserControl>
        <ffme:MediaElement
            x:Name="Media"
            Panel.ZIndex="-1"
            Background="Black"
            IsDesignPreviewEnabled="False"
            LoadedBehavior="Play"
            Stretch="Fill" />
</UserControl>
<UserControl>
<TabControl ItemsSource="{Binding Items}" SelectedItem="{Binding ActiveItem}" DisplayMemberPath="DisplayName">
   <TabControl.ContentTemplate>
      <DataTemplate>
         <ContentControl s:View.Model="{Binding}" VerticalContentAlignment="Stretch" HorizontalContentAlignment="Stretch" IsTabStop="False"/>
      </DataTemplate>
   </TabControl.ContentTemplate>
</TabControl>
<UserControl>

C

System.Console.WriteLine("Change Me Please!");

Command line ffplay

ffplay "hello.mp4"

Delete This Section

When I switch tabs, VS2022 out line: [23:41.432 | WRN | Engine.Commands ] Direct Command 'Close' not accepted. Open media before closing or changing media. MediaHashCode:10539156 [23:41.461 | DBG | Engine.Commands ] Dispose Entered. Waiting for Command Manager processor to stop. MediaHashCode:10539156 [23:41.462 | DBG | Engine.Commands ] Dispose is waiting for pending direct commands. MediaHashCode:10539156 [23:41.462 | DBG | Engine.Commands ] Dispose is closing media. MediaHashCode:10539156 [23:41.492 | DBG | Engine.Commands ] Dispose completed.

In new tabItem ffme not work,i think ffme is dispose,but parent not dispose!

who help me?