दरअसल, दस्तावेज़ीकरण कहता है कि आप इसे कर सकते हैं ... हालांकि इतने सारे शब्दों में नहीं। यहां बताया गया है यह प्लेलिस्ट पारसर्स के लिए इंटरफ़ेस के बारे में कहते हैं है:
VLC Lua playlist modules should define two functions:
* probe(): returns true if we want to handle the playlist in this script
* parse(): read the incoming data and return playlist item(s)
Playlist items use the same format as that expected in the
playlist.add() function (see general lua/README.txt)
आप playlist.add()
का वर्णन करने के लिए के माध्यम से पालन करें यह कहता है कि आइटम क्षेत्रों प्रदान कर सकते हैं की एक बड़ी सूची है। बहुत सारे विकल्प हैं (.name
, .title
, .artist
, आदि) लेकिन केवल एक ही आवश्यक .path
लगता है ... जो "आइटम का पूरा पथ/यूआरएल" है।
जहां तलाश करने के लिए की कोई स्पष्ट उल्लेख नहीं है, लेकिन मानकों प्रदान करने के लिए चुन सकते हैं में से एक .options
है, "वीएलसी विकल्प की एक सूची होने के लिए कहा। यह fullscreen
एक उदाहरण के रूप देता है। यदि --fullscreen
के लिए एक समानांतर ?! काम करता है, --start-time
और साथ ही --stop-time
काम जैसे अन्य कमांड लाइन विकल्प
अपने सिस्टम वे करते हैं, और यहां स्क्रिप्ट है पर
-- randomseek.lua
--
-- A compiled version of this file (.luac) should be put into the proper VLC
-- playlist parsers directory for your system type. See:
--
-- http://wiki.videolan.org/Documentation:Play_HowTo/Building_Lua_Playlist_Scripts
--
-- The file format is extremely simple and is merely alternating lines of
-- filenames and durations, such as if you had a file "example.randomseek"
-- it might contain:
--
-- foo.mp4
-- 3:04
-- bar.mov
-- 10:20
--
-- It simply will seek to a random location in the file and play a random
-- amount of the remaining time in the clip.
function probe()
-- seed the random number since other VLC lua plugins don't seem to
math.randomseed(os.time())
-- tell VLC we will handle anything ending in ".randomseek"
return string.match(vlc.path, ".randomseek$")
end
function parse()
-- VLC expects us to return a list of items, each item itself a list
-- of properties
playlist = {}
-- I'll assume a well formed input file but obviously you should do
-- error checking if writing something real
while true do
playlist_item = {}
line = vlc.readline()
if line == nil then
break --error handling goes here
end
playlist_item.path = line
line = vlc.readline()
if line == nil then
break --error handling goes here
end
for _min, _sec in string.gmatch(line, "(%d*):(%d*)")
do
duration = 60 * _min + _sec
end
-- math.random with integer argument returns an integer between
-- one and the number passed in inclusive, VLC uses zero based times
start_time = math.random(duration) - 1
stop_time = math.random(start_time, duration - 1)
-- give the viewer a hint of how long the clip will take
playlist_item.duration = stop_time - start_time
-- a playlist item has another list inside of it of options
playlist_item.options = {}
table.insert(playlist_item.options, "start-time="..tostring(start_time))
table.insert(playlist_item.options, "stop-time="..tostring(stop_time))
table.insert(playlist_item.options, "fullscreen")
-- add the item to the playlist
table.insert(playlist, playlist_item)
end
return playlist
end
मैं प्रलेखन और स्रोत कोड में घूमते हैं और यह * लगता है * यह संभव नहीं है। आपको शायद वीडियो लैन मंचों http://forum.videolan.org/viewforum.php?f=29 पर अपनी किस्मत आजमाएं। – ponzao
वीडियोLAN फ़ोरम पर यह प्रश्न, जहां कोई बार-बार 'निश्चित-समय' विकल्प के साथ वीएलसी लॉन्च कर रहा है, संबंधित लगता है: http://forum.videolan.org/viewtopic.php?f=29&t=90656 – HostileFork