Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[
- RS Mixer for VLC >= 1.1.0
- Authors: Willyb321 (https://tehsuperwilly.tech)
- --]]
- stations = {
- { name = "Radio Sidewinder", url = "http://radiosidewinder.out.airtime.pro:8000/radiosidewinder_a" },
- }
- function descriptor()
- return { title = "RS Mixer" ;
- version = "0.1" ;
- author = "Willyb321" ;
- capabilities = {} }
- end
- function activate()
- dlg = vlc.dialog("Streaming Radio Player")
- list = dlg:add_list(1, 3, 4, 1)
- button_play = dlg:add_button("Play", click_play, 1, 4, 4, 1)
- -- Add the radio stations
- for idx, details in ipairs(stations) do
- list:add_value(details.name, idx)
- end
- dlg:show()
- end
- function click_play()
- selection = list:get_selection()
- if (not selection) then return 1 end
- local sel = nil
- for idx, selectedItem in pairs(selection) do
- sel = idx
- break
- end
- details = stations[sel]
- -- Play the selected radio station
- playlistItem = {}
- playlistItem.path = details.url
- vlc.playlist.clear()
- vlc.playlist.add( {playlistItem} )
- test = vlc.playlist.get("media library")
- vlc.playlist.add( {test} )
- vlc.playlist.play()
- vlc.playlist.next()
- end
- function deactivate()
- end
- function close()
- vlc.deactivate()
- end
Advertisement
Add Comment
Please, Sign In to add comment