VLC .NET C# Auto play media only after buffering up to the set postion? -
i'm trying use vlc dotnet libraries available here. able load video , show within form. however, having trouble doing following:
when set media of vlccontrol, control auto plays media. not want. see other examples online explicit call play method made start media.
i need set position of video , buffer position before playing media. possible in way? can set position every time shows first frame until buffers set position.
how can play media starting @ position after media finished buffering set position?
here code have far:
public partial class vlcform : form { public vlcform() { initializecomponent(); loadmedia(@"c:\users\jonathan.trowbridge.wvs\desktop\samplevideo.mkv"); setstartposition((float)new random().nextdouble()); application.run(this); } private void setstartposition(float position) { vlccontrol.position = position; } private void loadmedia(string path) { try { vlccontrol.media = new pathmedia(path); } catch (keynotfoundexception exp) { messagebox.show("media not found.", "", messageboxbuttons.ok, messageboxicon.error); this.close(); environment.exit(1); } } }
update:
i found able prevent media automatically playing once vlccontext media property set adding pathmedia vlccontext medias , calling play on first item in list following code:
//vlccontrol.media = new pathmedia(path); vlccontrol.medias.add(new pathmedia(path)); vlccontrol.play(vlccontrol.medias[0]);
this feels super hacky , still doesn't solve issue of prebuffering video before displaying first frame.
Comments
Post a Comment