play rmtp stream
#1
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
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)
Reply
#2
kenneiv,

What is the exact error you are seeing?

I've only written one add on, but what you are doing looks a little strange to me.

If you know the url of a stream you want to play, all you have to do is one call to xbmc.Player.play Something like this:

Code:
xbmc.Player().play(item=link)

So what you are doing with the list item seems to be confusing the issue if you just want to play back a video with a known url. Also, I am not sure if it is case sensitive but I use "video" with a lower case v when setting the media type.
Reply
#3
Passing media to XBMC through it's api is pretty straight forward, can you elaborate on your problem ?
Image Lunatixz - Kodi / Beta repository
Image PseudoTV - Forum | Website | Youtube | Help?
Reply
#4
Hi, I have changed the code. The new code looks like this:
Code:
import xbmcgui
import xbmc
thumbnail = 'icon'
link = 'http://nerdvar.com/bilder/tlogg/NRK-nett-tv_lastened_mpldl_640x480.ogv'
title = 'Video player'
mediaType = 'video'
li = xbmcgui.ListItem(label=title, iconImage=thumbnail, thumbnailImage=thumbnail, path=link)
li.setInfo(type=mediaType, infoLabels={ "Title": title })
xbmc.Player().play(item=link)

But when i try to run the addon nothing is happening. What have done wrong here ?
Reply

Logout Mark Read Team Forum Stats Members Help
play rmtp stream0