Need some help with an Item Menu
#1
Hey im new just made this test app that runs a stream URL
PHP Code:
import xbmc
import xbmcgui

# Stream URL here
url "randomurl.m3u8"

listitem xbmcgui.ListItem("random")
listitem.setInfo('video', {'Title''random'})

# Play the Stream
xbmc.Player().play(urllistitem

That works so whenever i open the addon it just streams that, what im trying to do is have some options like a menu(gui) and execute a different url for each not sure where to start
Reply
#2
sorry if my questions stupid i just want to make clickable items that play the urls
Reply
#3
The info you need should be detailed in this tutorial post
the sample addon there is complicated for a beginner but it lays out the groundwork for how video plugins work.

basically, when your addon starts, you need to have a default portion that lists things. (your addon stops running after doing this)
when a user clicks on an item on that list, your addon is called again but this time, it gets a parameter "action=play" and another one called "video=videofile.mp4" (you set this up when building the previous list, they are just examples)

this time, instead of the default portion that lists things, your addon needs to parse the parameters and then call the appropriate function --> def router(paramstring):
finally, you need to have a portion in your addon to actually play the video. -->def play_video(path):


in the sample, they are categories, then a list of videos and finally to play the videos.
Reply

Logout Mark Read Team Forum Stats Members Help
Need some help with an Item Menu0