Click here to Skip to main content
15,890,579 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi all
In my small mediaplayer i am using a winforms wmp in my WPF

My prob is that all is fine except when i use

C#
private void axWindowsMediaPlayer_PlayStateChange(object sender, AxWMPLib._WMPOCXEvents_PlayStateChangeEvent e)
{
    if (myPlayList.Items.Count >= 1)
        if (e.newState == (int)WMPLib.WMPPlayState.wmppsMediaEnded)
        {
            myPlayList.Items.Remove(myPlayList.Items[0]);
            string CurrentCell = ((DataItem)myPlayList.Items[0]).Column3;
            GetFirstItemOfPlayList.Content = (CurrentCell);
            player.URL = CurrentCell;
            player.Ctlcontrols.play();






        }
}


the Player.url is correct - but it wont play the URL

i do have a cancel button with the above code and that works fine

any help would be greatly appreciated

cheers

Tony
Posted
Updated 14-Jun-13 2:10am
v2

It's not good to use WPF-Forms interop without a really convincing reason. The too libraries have very different nature, and WPF is based on DirectX, has almost nothing to do with Windows API and is actually much more suitable for video due to this fact.

Better use the component designed for WPF: System.Windows.Media.MediaPlayer:
http://msdn.microsoft.com/en-us/library/system.windows.media.mediaplayer.aspx[^].

—SA
 
Share this answer
 
Comments
Monjurul Habib 16-Jun-13 15:55pm    
5+
Sergey Alexandrovich Kryukov 16-Jun-13 22:36pm    
Thank you, Monjurul.
—SA
Hi SA
Thank you for your help

Cheers

Tony
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900