Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env /home/astra/astra
- playlist = {}
- ts_path = "/home/tv/static/upload/testing/"
- for val in utils.readdir(ts_path) do
- f_path = ts_path .. val
- table.insert(playlist, f_path)
- log.info(f_path)
- end
- instance = { item = 0, input = nil, output = nil, }
- function play_next_item();
- if instance.item == #playlist then
- instance.item = 1
- else
- instance.item = instance.item + 1
- end
- -- if instance.input then instance.input = nil end
- if instance.output then instance.output = nil end
- collectgarbage();
- instance.input = file_input({
- filename = playlist[instance.item],
- loop = false,
- callback = play_next_item
- })
- instance.output = udp_output({
- upstream = instance.input:stream(),
- addr = "239.0.23.255",
- port = 1234
- })
- end
- play_next_item();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement