private void PlayVideo(VideoInfo videoInfo) { if (videoInfo != null && videoInfo.files.video != null) { PlayFile playFile = new PlayFile(); playFile.AddAccessToSubForms(subFormVideoForm, subFormProgress); playFile.Play(videoInfo, videoInfo.files.video); } }
/// <summary> /// launch selected file /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void listView_DoubleClick(object sender, EventArgs e) { VideoItemFileInfo videoItemFileInfo = (VideoItemFileInfo)listView.SelectedItems[0].Tag; if (videoItemFileInfo == null) { return; } PlayFile playFile = new PlayFile(); playFile.AddAccessToSubForms(subFormVideoForm, subFormProgress); playFile.Play(videoItemFileInfo.videoInfo, videoItemFileInfo.videoItemFile); //bubble the event up if (this.fileList_DoubleClicked != null) { this.fileList_DoubleClicked(sender, e); } }
private void buttonPlay_Click(object sender, EventArgs e) { Button button = (Button)sender; if (selectedVideoInfo != null && selectedVideoInfo.files != null && selectedVideoInfo.files.video != null) { button.Enabled = false; button.Text = "Playing.."; PlayFile playFile = new PlayFile(); playFile.playFile_Completed += (senderPlay, eventPlay) => PlayFile_Completed(senderPlay, eventPlay, selectedVideoInfo); playFile.AddAccessToSubForms(this, subFormProgress); string videoFullName = selectedVideoInfo.GetFullName(selectedVideoInfo.files.video); FileInfo fileInfo = MyFile.FileInfo(videoFullName); if (fileInfo == null) { MessageBox.Show("Error trying to play video [" + selectedVideoInfo.files.video.Name + "]"); return; } playFile.Play(selectedVideoInfo, selectedVideoInfo.files.video); MyFormField.DelayButtonClick(button, "Play"); } }