[vlc-devel] When to read movie length using mediaPlayer?

Tony Anecito adanecito at yahoo.com
Sat Nov 28 11:20:52 CET 2009


Thanks Remi that helps me understand the situation. I was able to solve the problem though by using the mediaPlayer.hasVideoOutput() call.

In regards to coding I am a java coder by heart but have done quite a bit of C and some C++ under windows. I am working hard (3:00AM here) for the last week to get a new version of my simple Java portal out so I can get more kids to watch video via vlc so my focus is on that.

I have gotten up to 16 videos playing at the same time but seem to have some issues when going beyond 6 and I am working on that right now. I want to get it ultra stable at 6 and more if possible. Ending up putting alot of thread.sleep between jvlc method calls into vlc. That seems to cause jvm crashing to be less on faster multi-core CPU's.

Seems for some reason the video pops out of the java canvas sometimes after I have reached a certain number of videos. I am trying to fix that now the best I can. I need to figure out for windows what the default video mode is so I can send that as an option to the vlc instance what it get created in case the value for the default gets lost or set to something else for some reason.

Best Regards,
-Tony

--- On Sat, 11/28/09, Rémi Denis-Courmont <remi at remlab.net> wrote:

> From: Rémi Denis-Courmont <remi at remlab.net>
> Subject: Re: [vlc-devel] When to read movie length using mediaPlayer?
> To: vlc-devel at videolan.org
> Cc: "Tony Anecito" <adanecito at yahoo.com>
> Date: Saturday, November 28, 2009, 2:43 AM
> Le samedi 28 novembre 2009 09:49:18
> Tony Anecito, vous avez écrit :
> > Hi All,
> > 
> > I am running into an issue regarding viewing youtube
> videos using 1.0.4 &
> >  JVLC. I noticed that if I try to get the video
> length using
> >  mediaPlayer.getLength() right after play has
> started the video may report
> >  0 length or crash. Can the length of a video for
> youtube videos be
> >  determined without playing it first using the
> mediaPlayer object? The same
> >  question would be important for vidoes viewed
> via http.
> 
> In theory, LibVLC could load the file without playing it.
> The VLC playlist 
> already does that - but I think it's not implemented in
> LibVLC. Patch is 
> always welcome.
> 
> That said, it only works for local files, as it would be
> too slow for remote 
> inputs. So I think it wouldn't really help you. LibVLC
> emits an event when the 
> file has been parsed shortly after playback starts.
> 
> -- 
> Rémi Denis-Courmont
> http://www.remlab.net/
> 


      



More information about the vlc-devel mailing list