2014-02-14, 15:20
Hello,
I need some help with creating a very simple addon to xbmc. That should play a RMTP stream.
I have tried the following code but according to xbmc so it was the wrong structure.
default.py
until.py
I need some help with creating a very simple addon to xbmc. That should play a RMTP stream.
I have tried the following code but according to xbmc so it was the wrong structure.
default.py
Code:
import xbmcaddon, util
addon = xbmcaddon.Addon('plugin.video.france24.fr')
util.playMedia(addon.getAddonInfo('name'), addon.getAddonInfo('icon'),
'rtmp://stream2.france24.yacast.net:80/france24_live/fr playpath=f24_livefr app=france24_live/fr')
until.py
Code:
import xbmcgui, xbmc
def playMedia(title, thumbnail, link, mediaType='Video') :
"""Plays a video
Arguments:
title: the title to be displayed
thumbnail: the thumnail to be used as an icon and thumbnail
link: the link to the media to be played
mediaType: the type of media to play, defaults to Video. Known values are Video, Pictures, Music and Programs
"""
li = xbmcgui.ListItem(label=title, iconImage=thumbnail, thumbnailImage=thumbnail, path=link)
li.setInfo(type=mediaType, infoLabels={ "Title": title })
xbmc.Player().play(item=link, listitem=li)