C# VLC playlist autoplay it working stop when next video

◇◆丶佛笑我妖孽 提交于 2021-01-28 11:32:52

问题


when first video ended switch to second video program stop working:

private void axVLCPlugin21_MediaPlayerEndReached(object sender, EventArgs e)
{
    if (listBox1.SelectedIndex < (listBox1.Items.Count - 1))
    {
        axVLCPlugin21.playlist.next();
        listBox1.SelectedIndex += 1;
        listBox1.Update();
    }

    else
    {
        axVLCPlugin21.playlist.playItem(0);
        listBox1.SelectedIndex = 0;
        listBox1.Update();
    }
}

回答1:


    private void axVLCPlugin21_MediaPlayerEndReached(object sender, EventArgs e)
    {
        if (listBox1.SelectedIndex < (listBox1.Items.Count - 1))
        {
            axVLCPlugin21.playlist.stop();
            axVLCPlugin21.playlist.next();
            listBox1.SelectedIndex += 1;
            listBox1.Update();
        }
        else
        {
            axVLCPlugin21.playlist.stop();
            axVLCPlugin21.playlist.playItem(0);
            listBox1.SelectedIndex = 0;
            listBox1.Update();
        }
    }


来源:https://stackoverflow.com/questions/28124041/c-sharp-vlc-playlist-autoplay-it-working-stop-when-next-video

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!