input.position question

All you've ever wanted to know about the ActiveX, Mozilla plugins, the web interface and various PHP extensions
Yansky
Blank Cone
Blank Cone
Posts: 11
Joined: 24 Aug 2010 02:32

input.position question

Postby Yansky » 24 Aug 2010 08:06

I'm having some trouble understanding one of the plugin API methods. Specifically input.position

The docs say:
vlc.input.position: normalized position in multimedia stream item given as a float value between [0.0 - 1.0]
http://wiki.videolan.org/Documentation: ... put_object

I had to look up the term "normalized" cause I didn't understand what that meant: http://en.wikipedia.org/wiki/Scientific ... d_notation

I don't quite understand how vlc.input.position works. Is it the relative position of the player in relation to the bytestream?

I called the vlc.input.position method just after the video started playing to see what it would show and I got this: 0.0018034265376627445

How I interpret that number?

ams.fwd
New Cone
New Cone
Posts: 5
Joined: 11 Aug 2010 23:19

Re: input.position question

Postby ams.fwd » 24 Aug 2010 20:52

Normalized means that the value has been converted to within a set range. For e.g. if your video/stream is 10 mins long when its at the 1 min mark while playing the value would be 0.100000 as the position is normalized to 1 (i.e. the value will be between 0 and 1 and is calculated as current time/total time).

So 0.0018034265376627445 means that its played 0.18% of the total video. Taking the abovementioned example of a 10 min video, it means that the video is now at ~1.1s from the beginning. 10 * 60 * .0018

HTH
AM


Return to “Web and scripting”

Who is online

Users browsing this forum: No registered users and 8 guests