Windows Media Player ctlcontrols.play和URL不起作用 [英] Windows Media Player ctlcontrols.play and URL don't work

查看:404
本文介绍了Windows Media Player ctlcontrols.play和URL不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

    private void mediaPlayer_Enter()
    {
        string path = Path.GetFullPath(currentTrack.Text);
        System.Diagnostics.Debug.WriteLine(path);
        mediaPlayer.URL = path;
        mediaPlayer.Ctlcontrols.play();
    }

这是当媒体播放器的状态变为媒体结束"时被调用的代码.我知道它确实执行了那行代码,但仍然无法播放.它将项目从列表框(即播放列表)中取出,并将其加载到mediaPlayer中,但不会自动播放歌曲.我必须按下按钮才能开始播放-它确实可以直接播放.我在做什么错了?

This is the piece of code which is being called when the state of the media player turns to "media ended". I know that it does execute that line of code but it still doesn't play. It takes the item out of the listbox (which is the playlist) and loads it into the mediaPlayer but does not Automatically play the song. I have to press the button to start playing it - it has do play it stright away by itself. What am I doing wrong?

推荐答案

我相信这会自动播放您的媒体: http://msdn.microsoft. com/en-us/library/windows/desktop/dd562405(v = vs.85).aspx

I believe this will autoplay your media: http://msdn.microsoft.com/en-us/library/windows/desktop/dd562405(v=vs.85).aspx

如果AxWindowsMediaPlayer.settings.autoStart属性为true,则每当您设置currentMedia时,播放就会自动开始.

If the AxWindowsMediaPlayer.settings.autoStart property is true, playback begins automatically whenever you set currentMedia.

这篇关于Windows Media Player ctlcontrols.play和URL不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆