示例#1
0
        private async void BtStart_Click(object sender, EventArgs e)
        {
            mmLog.Text = string.Empty;

            MediaPlayer1.Debug_Mode = cbDebugMode.Checked;

            if (_videoInfoList.Count == 0)
            {
                MessageBox.Show("Please read formats first.");
                return;
            }

            MediaPlayer1.Source_Mode     = VFMediaPlayerSource.LAV;
            MediaPlayer1.Audio_PlayAudio = false;

            MediaPlayer1.Audio_AdditionalStreams_Clear();

            MediaPlayer1.FilenamesOrURL.Clear();
            MediaPlayer1.FilenamesOrURL.Add(_videoInfoList[cbVideoStream.SelectedIndex].Url);

            if (_videoInfoList[cbVideoStream.SelectedIndex].ToString().Contains("Muxed"))
            {
                MediaPlayer1.Audio_PlayAudio = true;
            }

            if (cbAudioStream.SelectedIndex > 0)
            {
                MediaPlayer1.Audio_PlayAudio = true;
                MediaPlayer1.Audio_AdditionalStreams_Add(_audioInfoList[cbAudioStream.SelectedIndex].Url);
            }

            await MediaPlayer1.PlayAsync();

            timer1.Start();
        }