public void Init() { Application.Init(); Application.UseSystemConsole = true; top = Application.Top; modeText = new Label(modes[0].ToString()); shuffle = false; LibVLCSharp.Shared.Core.Initialize(); _libVLC = new LibVLCSharp.Shared.LibVLC("-I", "null"); mp = new MediaPlayer(_libVLC); mp.TimeChanged += mp_TimeChanged; playList = new List<string>(); }
private void loadStudentExamVideo() { try { string response = mainController.professorGetStudentExamVideo(room_id, student_id); JArray jArray = (JArray)JsonConvert.DeserializeObject(response); Console.WriteLine(jArray); int count = jArray.Count; if (count > 0) { string url = (string)jArray[count - 1]["url"]; string started_at = (string)jArray[count - 1]["started_at"]; startTime = setTime(started_at); Core.Initialize(); libVLC = new LibVLCSharp.Shared.LibVLC(); videoView = new LibVLCSharp.WinForms.VideoView(); videoView.MediaPlayer = new LibVLCSharp.Shared.MediaPlayer(libVLC); videoView.MediaPlayer.Play(new Media(libVLC, url, FromType.FromLocation)); videoView.MediaPlayer.EndReached += MediaPlayer_EndReached; bookMarkPanel.Controls.Add(videoView); videoView.BringToFront(); videoView.Dock = DockStyle.Fill; status = true; Console.WriteLine(startTime); } } catch (Exception error) { Console.WriteLine(error); } }
/// <summary> /// Media Constructs a libvlc Media instance /// </summary> /// <param name="libVLC">A libvlc instance</param> /// <param name="mrl">A path, location, or node name, depending on the 3rd parameter</param> /// <param name="type">The type of the 2nd argument. \sa{FromType}</param> public Media(LibVLC libVLC, string mrl, FromType type = FromType.FromPath) : base(() => SelectNativeCtor(libVLC, mrl, type), Native.LibVLCMediaRelease) { }
/// <summary> /// Create a media for an already open file descriptor. /// The file descriptor shall be open for reading(or reading and writing). /// /// Regular file descriptors, pipe read descriptors and character device /// descriptors(including TTYs) are supported on all platforms. /// Block device descriptors are supported where available. /// Directory descriptors are supported on systems that provide fdopendir(). /// Sockets are supported on all platforms where they are file descriptors, /// i.e.all except Windows. /// /// \note This library will <b>not</b> automatically close the file descriptor /// under any circumstance.Nevertheless, a file descriptor can usually only be /// rendered once in a media player.To render it a second time, the file /// descriptor should probably be rewound to the beginning with lseek(). /// </summary> /// <param name="libVLC">A libvlc instance</param> /// <param name="fd">open file descriptor</param> public Media(LibVLC libVLC, int fd) : base(() => Native.LibVLCMediaNewFd(libVLC.NativeReference, fd), Native.LibVLCMediaRelease) { }
/// <summary> /// Create an empty media list. /// </summary> /// <param name="libVLC"></param> public MediaList(LibVLC libVLC) : base(() => Native.LibVLCMediaListNew(libVLC.NativeReference), Native.LibVLCMediaListRelease) { }