[Plugin Development] Send Video URL to MediaPlayer?

  • Hi, i'm developing an IPTV plugin and am trying to finish it up sometime soon.
    Everything's going quite well, I even used the Plugin Tutorial found on this website (very awesome btw :) ).
    However, i've found there seems to be one very important chapter missing in it....



    e.g., if i have a video URL - http://SomeHost.com/MyStream.m38u


    how do i access and call the Enigma2 Python class which will allow that to work?


    i have found that it is based on the Component.MediaPlayer python module, but i am uncertain as how to call this class and send a video link to it. This is the first time i've had to use Namespaces and OOP in python.



    thanks for your help :)

  • You can play local videos, mp3 or inet streams this way:


    Python
    from enigma import eServiceReference
    
    
    vod_url = 'http%3a//SomeHost.com/MyStream.m3u8'
    
    
    sref = eServiceReference(4097, 0, vod_url)
    self.session.nav.playService(sref)
  • THANK you very much :)



    I asked 10 other people, and all seemed to think i needed to search through endless lines of example code to find this one answer.
    Is there a Documentation repository which has example code, or at least some explanation of the usage of various components in Enigma2?

  • Zitat

    Originally posted by pzy-co
    You can play local videos, mp3 or inet streams this way:


    Python
    from enigma import eServiceReference
    
    
    vod_url = 'http%3a//SomeHost.com/MyStream.m3u8'
    
    
    sref = eServiceReference(4097, 0, vod_url)
    self.session.nav.playService(sref)


    as soon as i pass "self.session.nav.playService(sref)" is this supposed to start playing?


    i get no action (also doesn't crash) so i wonder if it happens to be my stream.


    or is there some kind of nav.playService method that i need to call in order to set the video status to isPlaying (or the equivalent thereof)

  • http://sourceforge.net/p/cocyd…/general/thread/cff8cc43/


    Code
    I have a little trouble with this plugin.
    If i want play ts-stream, then the receiver can not reproduce because sRef should be something like "1:0:..." and he filed his "4097:0:...".
    If edited line
    self._service = eServiceReference(4097, 0, changed["source"])
    to
    self._service = eServiceReference(1, 0, changed["source"])
    in file "renderer.py",
    then ts-stream works, but all other don`t.
    Please solve this?
    Thanks


    maybe this will be helpful to other developers.


    i really want to give up on Enigma2.


    it seems this is the only thing that poor developing and arabic countries are using.
    they really should just use a REAL stb that uses OpenElec or XBMC.


    No documentation and retarded python interpreters that tell you there are errors on lines that have never been changed is just insane and can not be debugged.

  • What is CoCy?!?

    Python
    from cocy.upnp.device_server import UPnPDeviceServer


    I think UPNP/DLNA server is implemented in the new dreamboxes...

  • iptvDevGuy


    "self.session.nav.playService(sref)" is all you need to watch a stream.
    If your stream doesn't start, you should get the reason in telnet.
    4097 was fine in my test, but i only tried this on 2 IPTV-channels with *.m3u8.

  • playing 4097:0:0:0:0:0:0:0:0:0:http%3a//x.x.x.x/hls/bbc_world.m3u8
    stopping thread.
    FILEPUSH THREAD STOP
    thread joined 0
    [eDVBCAService] remove channel 0x1310020
    [eDVBCAService] write leave transponder failed!!
    [eDVBLocalTimerHandler] remove channel 0x1310020
    [eEPGCache] remove channel 0x1310020
    eServiceMP3::construct!
    eServiceMP3::playbin2 uri=http://82.135.224.141/hls/bbc_world.m3u8
    eServiceMP3::starting pipeline
    RemovePopup, id = ZapError
    (found in notifications)
    [RemoteControl.sendEvent] command was was sent (key: 352, flag: 0)
    screen cleanup!
    eServiceMP3::state transition NULL -> READY
    Gstreamer error: Connection terminated unexpectedly (3) from source
    Gstreamer error: A network error occured, or the server closed the connection unexpectedly. (9) from source
    Gstreamer error: Internal data flow error. (1) from source
    screen cleanup!