private void Window_Unloaded(object sender, RoutedEventArgs e) { if (rtmpModel.IsStart) { ZJRtmpPush.Stop(); rtmpModel.IsStart = false; } }
/// <summary> /// The start_Click /// </summary> /// <param name="sender">The sender<see cref="object"/></param> /// <param name="e">The e<see cref="RoutedEventArgs"/></param> private void start_Click(object sender, RoutedEventArgs e) { if (rtmpModel.IsStart) { ZJRtmpPush.Stop(); rtmpModel.IsStart = false; } else { var selectIndex = audio_list_box.SelectedIndex; if (selectIndex >= 0 && selectIndex < rtmpModel.MYAudioDevices.Count) { var name = rtmpModel.MYAudioDevices[selectIndex].name; ZJRtmpPush.StartPush(name, "rtmp://live.xhkjedu.com/tt/01"); rtmpModel.IsStart = true; } else { MessageBox.Show("没有可用的音频输入设备"); } } }