Sascha-L / WPF-MediaKit

Microsoft Public License
366 stars 116 forks source link

FeatureRequest Adding PlayerState #63

Open skaterlui opened 6 years ago

skaterlui commented 6 years ago

Hello,

it would be very nice to have the playerstate implemented which was postet by felizk to the old home of mediakit. https://wpfmediakit.codeplex.com/SourceControl/list/patches I'm using the state for automation tasks in my application. For example: Using space key to play, pause or switch to the next media when a specific state is set.


Case Keyboard.IsKeyDown(Key.Space)
    Select Case ViewModel_MediaPlayer.PlayerState
        Case PlayerState.Playing
            ViewModel_MediaPlayer.Player.Pause()
        Case PlayerState.Stopped
            ViewModel_MediaPlayer.Player.Pause()
        Case PlayerState.Paused
            ViewModel_MediaPlayer.Player.Play()
        Case PlayerState.Closed
            If ViewModelReference.Current.VM_Browser.Current_FileSystemEntry IsNot Nothing Then
                ViewModel_MediaPlayer.Current_MediaFile = ViewModelReference.Current.ViewModel_Browser.Current_FileSystemEntry
                ViewModel_MediaPlayer.Execute_Play(ViewModel_MediaPlayer.Player)
            End If
    End Select
'''
skaterlui commented 6 years ago

@Rhuaer I've added the playerstate in my pr.

skaterlui commented 6 years ago

Since codeplex is archived the link above isn't working anymore.