From: kos Date: Mon, 30 Apr 2012 06:36:27 +0000 (+0900) Subject: add plugin(streamtv) X-Git-Url: http://code.vuplus.com/gitweb/?p=vuplus_dvbapp;a=commitdiff_plain;h=0ca21ce174763f6e0d94b0cde73f6aa443e898dc add plugin(streamtv) --- diff --git a/configure.ac b/configure.ac index 4fd69df..88abda3 100644 --- a/configure.ac +++ b/configure.ac @@ -186,6 +186,9 @@ lib/python/Plugins/Extensions/WebBrowser/keymap/Makefile lib/python/Plugins/Extensions/WebBrowser/desc/Makefile lib/python/Plugins/Extensions/VuplusEvent/Makefile lib/python/Plugins/Extensions/VuplusEvent/meta/Makefile +lib/python/Plugins/Extensions/StreamTV/Makefile +lib/python/Plugins/Extensions/StreamTV/meta/Makefile +lib/python/Plugins/Extensions/StreamTV/icons/Makefile lib/python/Plugins/SystemPlugins/CleanupWizard/Makefile lib/python/Plugins/SystemPlugins/CleanupWizard/meta/Makefile lib/python/Plugins/SystemPlugins/CommonInterfaceAssignment/Makefile diff --git a/lib/python/Plugins/Extensions/Makefile.am b/lib/python/Plugins/Extensions/Makefile.am index a123e54..df1d9ef 100755 --- a/lib/python/Plugins/Extensions/Makefile.am +++ b/lib/python/Plugins/Extensions/Makefile.am @@ -1,7 +1,7 @@ installdir = $(pkglibdir)/python/Plugins/Extensions SUBDIRS = TuxboxPlugins CutListEditor PicturePlayer MediaScanner MediaPlayer GraphMultiEPG SocketMMI DVDBurn Modem WebBrowser \ - VuplusEvent + VuplusEvent StreamTV if HAVE_LIBDDVD SUBDIRS += DVDPlayer diff --git a/lib/python/Plugins/Extensions/StreamTV/Makefile.am b/lib/python/Plugins/Extensions/StreamTV/Makefile.am new file mode 100644 index 0000000..a634612 --- /dev/null +++ b/lib/python/Plugins/Extensions/StreamTV/Makefile.am @@ -0,0 +1,13 @@ +installdir = $(pkglibdir)/python/Plugins/Extensions/StreamTV + +SUBDIRS = meta icons + +install_PYTHON = \ + channel_background.png \ + stream.xml \ + rtmpdump \ + __init__.py \ + plugin.py + +install-data-hook: + @chmod +x $(DESTDIR)$(installdir)/rtmpdump diff --git a/lib/python/Plugins/Extensions/StreamTV/__init__.py b/lib/python/Plugins/Extensions/StreamTV/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/lib/python/Plugins/Extensions/StreamTV/channel_background.png b/lib/python/Plugins/Extensions/StreamTV/channel_background.png new file mode 100644 index 0000000..0d716dd Binary files /dev/null and b/lib/python/Plugins/Extensions/StreamTV/channel_background.png differ diff --git a/lib/python/Plugins/Extensions/StreamTV/icons/Makefile.am b/lib/python/Plugins/Extensions/StreamTV/icons/Makefile.am new file mode 100644 index 0000000..6bc5709 --- /dev/null +++ b/lib/python/Plugins/Extensions/StreamTV/icons/Makefile.am @@ -0,0 +1,5 @@ +installdir = $(libdir)/enigma2/python/Plugins/Extensions/StreamTV/icons + +install_DATA = *.png + + diff --git a/lib/python/Plugins/Extensions/StreamTV/icons/alfa.png b/lib/python/Plugins/Extensions/StreamTV/icons/alfa.png new file mode 100644 index 0000000..1897c8d Binary files /dev/null and b/lib/python/Plugins/Extensions/StreamTV/icons/alfa.png differ diff --git a/lib/python/Plugins/Extensions/StreamTV/icons/alsat.png b/lib/python/Plugins/Extensions/StreamTV/icons/alsat.png new file mode 100644 index 0000000..44aecbe Binary files /dev/null and b/lib/python/Plugins/Extensions/StreamTV/icons/alsat.png differ diff --git a/lib/python/Plugins/Extensions/StreamTV/icons/antennalatina.png b/lib/python/Plugins/Extensions/StreamTV/icons/antennalatina.png new file mode 100644 index 0000000..5678002 Binary files /dev/null and b/lib/python/Plugins/Extensions/StreamTV/icons/antennalatina.png differ diff --git a/lib/python/Plugins/Extensions/StreamTV/icons/barb2.png b/lib/python/Plugins/Extensions/StreamTV/icons/barb2.png new file mode 100644 index 0000000..d135a5a Binary files /dev/null and b/lib/python/Plugins/Extensions/StreamTV/icons/barb2.png differ diff --git a/lib/python/Plugins/Extensions/StreamTV/icons/bbcpersian.png b/lib/python/Plugins/Extensions/StreamTV/icons/bbcpersian.png new file mode 100644 index 0000000..c8947c3 Binary files /dev/null and b/lib/python/Plugins/Extensions/StreamTV/icons/bbcpersian.png differ diff --git a/lib/python/Plugins/Extensions/StreamTV/icons/bbcworldnews.png b/lib/python/Plugins/Extensions/StreamTV/icons/bbcworldnews.png new file mode 100644 index 0000000..43494f7 Binary files /dev/null and b/lib/python/Plugins/Extensions/StreamTV/icons/bbcworldnews.png differ diff --git a/lib/python/Plugins/Extensions/StreamTV/icons/benficatv.png b/lib/python/Plugins/Extensions/StreamTV/icons/benficatv.png new file mode 100644 index 0000000..7b19dfc Binary files /dev/null and b/lib/python/Plugins/Extensions/StreamTV/icons/benficatv.png differ diff --git a/lib/python/Plugins/Extensions/StreamTV/icons/bloombergtv.png b/lib/python/Plugins/Extensions/StreamTV/icons/bloombergtv.png new file mode 100644 index 0000000..ca261fc Binary files /dev/null and b/lib/python/Plugins/Extensions/StreamTV/icons/bloombergtv.png differ diff --git a/lib/python/Plugins/Extensions/StreamTV/icons/btr.png b/lib/python/Plugins/Extensions/StreamTV/icons/btr.png new file mode 100644 index 0000000..d2fd0f0 Binary files /dev/null and b/lib/python/Plugins/Extensions/StreamTV/icons/btr.png differ diff --git a/lib/python/Plugins/Extensions/StreamTV/icons/ctn.png b/lib/python/Plugins/Extensions/StreamTV/icons/ctn.png new file mode 100644 index 0000000..4bfc1e9 Binary files /dev/null and b/lib/python/Plugins/Extensions/StreamTV/icons/ctn.png differ diff --git a/lib/python/Plugins/Extensions/StreamTV/icons/default.png b/lib/python/Plugins/Extensions/StreamTV/icons/default.png new file mode 100644 index 0000000..be11be1 Binary files /dev/null and b/lib/python/Plugins/Extensions/StreamTV/icons/default.png differ diff --git a/lib/python/Plugins/Extensions/StreamTV/icons/dongnai1.png b/lib/python/Plugins/Extensions/StreamTV/icons/dongnai1.png new file mode 100644 index 0000000..2e2772e Binary files /dev/null and b/lib/python/Plugins/Extensions/StreamTV/icons/dongnai1.png differ diff --git a/lib/python/Plugins/Extensions/StreamTV/icons/euronews.png b/lib/python/Plugins/Extensions/StreamTV/icons/euronews.png new file mode 100644 index 0000000..9dadff5 Binary files /dev/null and b/lib/python/Plugins/Extensions/StreamTV/icons/euronews.png differ diff --git a/lib/python/Plugins/Extensions/StreamTV/icons/euronews_uk.png b/lib/python/Plugins/Extensions/StreamTV/icons/euronews_uk.png new file mode 100644 index 0000000..66f4e1c Binary files /dev/null and b/lib/python/Plugins/Extensions/StreamTV/icons/euronews_uk.png differ diff --git a/lib/python/Plugins/Extensions/StreamTV/icons/eurosport.png b/lib/python/Plugins/Extensions/StreamTV/icons/eurosport.png new file mode 100644 index 0000000..0d46b88 Binary files /dev/null and b/lib/python/Plugins/Extensions/StreamTV/icons/eurosport.png differ diff --git a/lib/python/Plugins/Extensions/StreamTV/icons/foodnetwork.png b/lib/python/Plugins/Extensions/StreamTV/icons/foodnetwork.png new file mode 100644 index 0000000..9264b6c Binary files /dev/null and b/lib/python/Plugins/Extensions/StreamTV/icons/foodnetwork.png differ diff --git a/lib/python/Plugins/Extensions/StreamTV/icons/formusic.png b/lib/python/Plugins/Extensions/StreamTV/icons/formusic.png new file mode 100644 index 0000000..58da11d Binary files /dev/null and b/lib/python/Plugins/Extensions/StreamTV/icons/formusic.png differ diff --git a/lib/python/Plugins/Extensions/StreamTV/icons/freshtv.png b/lib/python/Plugins/Extensions/StreamTV/icons/freshtv.png new file mode 100644 index 0000000..e0af225 Binary files /dev/null and b/lib/python/Plugins/Extensions/StreamTV/icons/freshtv.png differ diff --git a/lib/python/Plugins/Extensions/StreamTV/icons/hdextreme.png b/lib/python/Plugins/Extensions/StreamTV/icons/hdextreme.png new file mode 100644 index 0000000..068d96a Binary files /dev/null and b/lib/python/Plugins/Extensions/StreamTV/icons/hdextreme.png differ diff --git a/lib/python/Plugins/Extensions/StreamTV/icons/hdprocess.png b/lib/python/Plugins/Extensions/StreamTV/icons/hdprocess.png new file mode 100644 index 0000000..1cba40a Binary files /dev/null and b/lib/python/Plugins/Extensions/StreamTV/icons/hdprocess.png differ diff --git a/lib/python/Plugins/Extensions/StreamTV/icons/hdtravel.png b/lib/python/Plugins/Extensions/StreamTV/icons/hdtravel.png new file mode 100644 index 0000000..7d75f6c Binary files /dev/null and b/lib/python/Plugins/Extensions/StreamTV/icons/hdtravel.png differ diff --git a/lib/python/Plugins/Extensions/StreamTV/icons/hgtv.png b/lib/python/Plugins/Extensions/StreamTV/icons/hgtv.png new file mode 100644 index 0000000..c69930e Binary files /dev/null and b/lib/python/Plugins/Extensions/StreamTV/icons/hgtv.png differ diff --git a/lib/python/Plugins/Extensions/StreamTV/icons/intereconomiabiz.png b/lib/python/Plugins/Extensions/StreamTV/icons/intereconomiabiz.png new file mode 100644 index 0000000..0db6a14 Binary files /dev/null and b/lib/python/Plugins/Extensions/StreamTV/icons/intereconomiabiz.png differ diff --git a/lib/python/Plugins/Extensions/StreamTV/icons/intertv.png b/lib/python/Plugins/Extensions/StreamTV/icons/intertv.png new file mode 100644 index 0000000..4f68ac7 Binary files /dev/null and b/lib/python/Plugins/Extensions/StreamTV/icons/intertv.png differ diff --git a/lib/python/Plugins/Extensions/StreamTV/icons/italytv.png b/lib/python/Plugins/Extensions/StreamTV/icons/italytv.png new file mode 100644 index 0000000..3e219db Binary files /dev/null and b/lib/python/Plugins/Extensions/StreamTV/icons/italytv.png differ diff --git a/lib/python/Plugins/Extensions/StreamTV/icons/k1.png b/lib/python/Plugins/Extensions/StreamTV/icons/k1.png new file mode 100644 index 0000000..5781210 Binary files /dev/null and b/lib/python/Plugins/Extensions/StreamTV/icons/k1.png differ diff --git a/lib/python/Plugins/Extensions/StreamTV/icons/kanal5.png b/lib/python/Plugins/Extensions/StreamTV/icons/kanal5.png new file mode 100644 index 0000000..6c51f64 Binary files /dev/null and b/lib/python/Plugins/Extensions/StreamTV/icons/kanal5.png differ diff --git a/lib/python/Plugins/Extensions/StreamTV/icons/kontrachannel.png b/lib/python/Plugins/Extensions/StreamTV/icons/kontrachannel.png new file mode 100644 index 0000000..007c5d2 Binary files /dev/null and b/lib/python/Plugins/Extensions/StreamTV/icons/kontrachannel.png differ diff --git a/lib/python/Plugins/Extensions/StreamTV/icons/legend.png b/lib/python/Plugins/Extensions/StreamTV/icons/legend.png new file mode 100644 index 0000000..534ac76 Binary files /dev/null and b/lib/python/Plugins/Extensions/StreamTV/icons/legend.png differ diff --git a/lib/python/Plugins/Extensions/StreamTV/icons/milanonow.png b/lib/python/Plugins/Extensions/StreamTV/icons/milanonow.png new file mode 100644 index 0000000..8c9be41 Binary files /dev/null and b/lib/python/Plugins/Extensions/StreamTV/icons/milanonow.png differ diff --git a/lib/python/Plugins/Extensions/StreamTV/icons/msnbc.png b/lib/python/Plugins/Extensions/StreamTV/icons/msnbc.png new file mode 100644 index 0000000..62d01fe Binary files /dev/null and b/lib/python/Plugins/Extensions/StreamTV/icons/msnbc.png differ diff --git a/lib/python/Plugins/Extensions/StreamTV/icons/nasahd.png b/lib/python/Plugins/Extensions/StreamTV/icons/nasahd.png new file mode 100644 index 0000000..a5cf8e4 Binary files /dev/null and b/lib/python/Plugins/Extensions/StreamTV/icons/nasahd.png differ diff --git a/lib/python/Plugins/Extensions/StreamTV/icons/nhkworld.png b/lib/python/Plugins/Extensions/StreamTV/icons/nhkworld.png new file mode 100644 index 0000000..ca0364e Binary files /dev/null and b/lib/python/Plugins/Extensions/StreamTV/icons/nhkworld.png differ diff --git a/lib/python/Plugins/Extensions/StreamTV/icons/nova.png b/lib/python/Plugins/Extensions/StreamTV/icons/nova.png new file mode 100644 index 0000000..eb34956 Binary files /dev/null and b/lib/python/Plugins/Extensions/StreamTV/icons/nova.png differ diff --git a/lib/python/Plugins/Extensions/StreamTV/icons/ort.png b/lib/python/Plugins/Extensions/StreamTV/icons/ort.png new file mode 100644 index 0000000..a97838e Binary files /dev/null and b/lib/python/Plugins/Extensions/StreamTV/icons/ort.png differ diff --git a/lib/python/Plugins/Extensions/StreamTV/icons/piktvcom.png b/lib/python/Plugins/Extensions/StreamTV/icons/piktvcom.png new file mode 100644 index 0000000..0785754 Binary files /dev/null and b/lib/python/Plugins/Extensions/StreamTV/icons/piktvcom.png differ diff --git a/lib/python/Plugins/Extensions/StreamTV/icons/playme.png b/lib/python/Plugins/Extensions/StreamTV/icons/playme.png new file mode 100644 index 0000000..6c4f20c Binary files /dev/null and b/lib/python/Plugins/Extensions/StreamTV/icons/playme.png differ diff --git a/lib/python/Plugins/Extensions/StreamTV/icons/premieretvru.png b/lib/python/Plugins/Extensions/StreamTV/icons/premieretvru.png new file mode 100644 index 0000000..11365a0 Binary files /dev/null and b/lib/python/Plugins/Extensions/StreamTV/icons/premieretvru.png differ diff --git a/lib/python/Plugins/Extensions/StreamTV/icons/radio105.png b/lib/python/Plugins/Extensions/StreamTV/icons/radio105.png new file mode 100644 index 0000000..2572c58 Binary files /dev/null and b/lib/python/Plugins/Extensions/StreamTV/icons/radio105.png differ diff --git a/lib/python/Plugins/Extensions/StreamTV/icons/radiomontecarlo.png b/lib/python/Plugins/Extensions/StreamTV/icons/radiomontecarlo.png new file mode 100644 index 0000000..02d648d Binary files /dev/null and b/lib/python/Plugins/Extensions/StreamTV/icons/radiomontecarlo.png differ diff --git a/lib/python/Plugins/Extensions/StreamTV/icons/reduta.png b/lib/python/Plugins/Extensions/StreamTV/icons/reduta.png new file mode 100644 index 0000000..00a91fc Binary files /dev/null and b/lib/python/Plugins/Extensions/StreamTV/icons/reduta.png differ diff --git a/lib/python/Plugins/Extensions/StreamTV/icons/romauno.png b/lib/python/Plugins/Extensions/StreamTV/icons/romauno.png new file mode 100644 index 0000000..c1ce5a9 Binary files /dev/null and b/lib/python/Plugins/Extensions/StreamTV/icons/romauno.png differ diff --git a/lib/python/Plugins/Extensions/StreamTV/icons/rougefm.png b/lib/python/Plugins/Extensions/StreamTV/icons/rougefm.png new file mode 100644 index 0000000..31ffbbc Binary files /dev/null and b/lib/python/Plugins/Extensions/StreamTV/icons/rougefm.png differ diff --git a/lib/python/Plugins/Extensions/StreamTV/icons/rusiatoday.png b/lib/python/Plugins/Extensions/StreamTV/icons/rusiatoday.png new file mode 100644 index 0000000..ebc99a6 Binary files /dev/null and b/lib/python/Plugins/Extensions/StreamTV/icons/rusiatoday.png differ diff --git a/lib/python/Plugins/Extensions/StreamTV/icons/sbtbrasil.png b/lib/python/Plugins/Extensions/StreamTV/icons/sbtbrasil.png new file mode 100644 index 0000000..07883ee Binary files /dev/null and b/lib/python/Plugins/Extensions/StreamTV/icons/sbtbrasil.png differ diff --git a/lib/python/Plugins/Extensions/StreamTV/icons/shaber.png b/lib/python/Plugins/Extensions/StreamTV/icons/shaber.png new file mode 100644 index 0000000..e752aeb Binary files /dev/null and b/lib/python/Plugins/Extensions/StreamTV/icons/shaber.png differ diff --git a/lib/python/Plugins/Extensions/StreamTV/icons/sicnoticias.png b/lib/python/Plugins/Extensions/StreamTV/icons/sicnoticias.png new file mode 100644 index 0000000..e36c059 Binary files /dev/null and b/lib/python/Plugins/Extensions/StreamTV/icons/sicnoticias.png differ diff --git a/lib/python/Plugins/Extensions/StreamTV/icons/sitel3.png b/lib/python/Plugins/Extensions/StreamTV/icons/sitel3.png new file mode 100644 index 0000000..8737a20 Binary files /dev/null and b/lib/python/Plugins/Extensions/StreamTV/icons/sitel3.png differ diff --git a/lib/python/Plugins/Extensions/StreamTV/icons/skytg24.png b/lib/python/Plugins/Extensions/StreamTV/icons/skytg24.png new file mode 100644 index 0000000..0ed045f Binary files /dev/null and b/lib/python/Plugins/Extensions/StreamTV/icons/skytg24.png differ diff --git a/lib/python/Plugins/Extensions/StreamTV/icons/sport1tv.png b/lib/python/Plugins/Extensions/StreamTV/icons/sport1tv.png new file mode 100644 index 0000000..5790aa8 Binary files /dev/null and b/lib/python/Plugins/Extensions/StreamTV/icons/sport1tv.png differ diff --git a/lib/python/Plugins/Extensions/StreamTV/icons/sunnews.png b/lib/python/Plugins/Extensions/StreamTV/icons/sunnews.png new file mode 100644 index 0000000..8343ed7 Binary files /dev/null and b/lib/python/Plugins/Extensions/StreamTV/icons/sunnews.png differ diff --git a/lib/python/Plugins/Extensions/StreamTV/icons/telma.png b/lib/python/Plugins/Extensions/StreamTV/icons/telma.png new file mode 100644 index 0000000..edf3e32 Binary files /dev/null and b/lib/python/Plugins/Extensions/StreamTV/icons/telma.png differ diff --git a/lib/python/Plugins/Extensions/StreamTV/icons/teltemadridsat.png b/lib/python/Plugins/Extensions/StreamTV/icons/teltemadridsat.png new file mode 100644 index 0000000..210c723 Binary files /dev/null and b/lib/python/Plugins/Extensions/StreamTV/icons/teltemadridsat.png differ diff --git a/lib/python/Plugins/Extensions/StreamTV/icons/toptech.png b/lib/python/Plugins/Extensions/StreamTV/icons/toptech.png new file mode 100644 index 0000000..ab79de8 Binary files /dev/null and b/lib/python/Plugins/Extensions/StreamTV/icons/toptech.png differ diff --git a/lib/python/Plugins/Extensions/StreamTV/icons/torinow.png b/lib/python/Plugins/Extensions/StreamTV/icons/torinow.png new file mode 100644 index 0000000..88991dc Binary files /dev/null and b/lib/python/Plugins/Extensions/StreamTV/icons/torinow.png differ diff --git a/lib/python/Plugins/Extensions/StreamTV/icons/tvbiznes.png b/lib/python/Plugins/Extensions/StreamTV/icons/tvbiznes.png new file mode 100644 index 0000000..696aa31 Binary files /dev/null and b/lib/python/Plugins/Extensions/StreamTV/icons/tvbiznes.png differ diff --git a/lib/python/Plugins/Extensions/StreamTV/icons/tvhaugaland.png b/lib/python/Plugins/Extensions/StreamTV/icons/tvhaugaland.png new file mode 100644 index 0000000..d83f867 Binary files /dev/null and b/lib/python/Plugins/Extensions/StreamTV/icons/tvhaugaland.png differ diff --git a/lib/python/Plugins/Extensions/StreamTV/icons/unipbrasil.png b/lib/python/Plugins/Extensions/StreamTV/icons/unipbrasil.png new file mode 100644 index 0000000..5a6e6aa Binary files /dev/null and b/lib/python/Plugins/Extensions/StreamTV/icons/unipbrasil.png differ diff --git a/lib/python/Plugins/Extensions/StreamTV/icons/urotictv.png b/lib/python/Plugins/Extensions/StreamTV/icons/urotictv.png new file mode 100644 index 0000000..265df2d Binary files /dev/null and b/lib/python/Plugins/Extensions/StreamTV/icons/urotictv.png differ diff --git a/lib/python/Plugins/Extensions/StreamTV/icons/ustop40.png b/lib/python/Plugins/Extensions/StreamTV/icons/ustop40.png new file mode 100644 index 0000000..1edd9c2 Binary files /dev/null and b/lib/python/Plugins/Extensions/StreamTV/icons/ustop40.png differ diff --git a/lib/python/Plugins/Extensions/StreamTV/icons/yumurcak.png b/lib/python/Plugins/Extensions/StreamTV/icons/yumurcak.png new file mode 100644 index 0000000..bce2691 Binary files /dev/null and b/lib/python/Plugins/Extensions/StreamTV/icons/yumurcak.png differ diff --git a/lib/python/Plugins/Extensions/StreamTV/meta/Makefile.am b/lib/python/Plugins/Extensions/StreamTV/meta/Makefile.am new file mode 100644 index 0000000..cfac050 --- /dev/null +++ b/lib/python/Plugins/Extensions/StreamTV/meta/Makefile.am @@ -0,0 +1,3 @@ +installdir = $(datadir)/meta + +dist_install_DATA = plugin_streamtv.xml diff --git a/lib/python/Plugins/Extensions/StreamTV/meta/plugin_streamtv.xml b/lib/python/Plugins/Extensions/StreamTV/meta/plugin_streamtv.xml new file mode 100644 index 0000000..7464ee6 --- /dev/null +++ b/lib/python/Plugins/Extensions/StreamTV/meta/plugin_streamtv.xml @@ -0,0 +1,17 @@ + + + + + + kos + StreamTV + enigma2-plugin-extensions-streamtv + IPTV Player + Watching IPTV implemented by RTSP/RTMP protocol. + + + + + + + diff --git a/lib/python/Plugins/Extensions/StreamTV/plugin.py b/lib/python/Plugins/Extensions/StreamTV/plugin.py new file mode 100644 index 0000000..691506a --- /dev/null +++ b/lib/python/Plugins/Extensions/StreamTV/plugin.py @@ -0,0 +1,405 @@ +from Plugins.Plugin import PluginDescriptor + +import os +from xml.etree.cElementTree import fromstring, ElementTree + +from enigma import gFont, eTimer, eConsoleAppContainer, ePicLoad, loadPNG, getDesktop, eServiceReference, iPlayableService, eListboxPythonMultiContent, RT_HALIGN_LEFT, RT_HALIGN_RIGHT, RT_HALIGN_CENTER, RT_VALIGN_CENTER + +from Screens.Screen import Screen +from Screens.ChoiceBox import ChoiceBox +from Screens.MessageBox import MessageBox +from Screens.InfoBarGenerics import InfoBarNotifications + +from Components.Button import Button +from Components.Label import Label +from Components.ConfigList import ConfigListScreen +from Components.Sources.StaticText import StaticText +from Components.ActionMap import NumberActionMap, ActionMap +from Components.config import config, ConfigSelection, getConfigListEntry, ConfigText, ConfigDirectory, ConfigYesNo, ConfigSelection +from Components.FileList import FileList, FileEntryComponent +from Components.MenuList import MenuList +from Components.Pixmap import Pixmap, MovingPixmap +from Components.AVSwitch import AVSwitch +from Components.ServiceEventTracker import ServiceEventTracker + +from Tools.Directories import fileExists, resolveFilename, SCOPE_PLUGINS + +PLUGIN_PATH = resolveFilename(SCOPE_PLUGINS, "Extensions/StreamTV") + +class StreamTVPlayer(Screen, InfoBarNotifications): + skin = """ + + + + + + + Position + + + """ % (PLUGIN_PATH) + + PLAYER_IDLE = 0 + PLAYER_PLAYING = 1 + PLAYER_PAUSED = 2 + def __init__(self, session, service, cbServiceCommand, chName, chURL, chIcon): + Screen.__init__(self, session) + InfoBarNotifications.__init__(self) + + isEmpty = lambda x: x is None or len(x)==0 or x == 'None' + if isEmpty(chName): chName = 'Unknown' + if isEmpty(chURL): chURL = 'Unknown' + if isEmpty(chIcon): chIcon = 'default.png' + chIcon = '%s/icons/%s'%(PLUGIN_PATH,chIcon) + self.session = session + self.service = service + self.cbServiceCommand = cbServiceCommand + self["actions"] = ActionMap(["OkCancelActions", "InfobarSeekActions", "MediaPlayerActions", "MovieSelectionActions"], { + "ok": self.doInfoAction, + "cancel": self.doExit, + "stop": self.doExit, + "playpauseService": self.playpauseService, + }, -2) + + self.__event_tracker = ServiceEventTracker(screen = self, eventmap = { + iPlayableService.evSeekableStatusChanged: self.__seekableStatusChanged, + iPlayableService.evStart: self.__serviceStarted, + iPlayableService.evEOF: self.__evEOF, + }) + + self.hidetimer = eTimer() + self.hidetimer.timeout.get().append(self.doInfoAction) + + self.state = self.PLAYER_PLAYING + self.lastseekstate = self.PLAYER_PLAYING + self.__seekableStatusChanged() + + self.onClose.append(self.__onClose) + self.doPlay() + + self['channel_icon'] = Pixmap() + self['channel_name'] = Label(chName) + self['channel_uri'] = Label(chURL) + + self.picload = ePicLoad() + self.scale = AVSwitch().getFramebufferScale() + self.picload.PictureData.get().append(self.cbDrawChannelIcon) + print self.scale[0] + print self.scale[1] + self.picload.setPara((35, 35, self.scale[0], self.scale[1], False, 0, "#00000000")) + self.picload.startDecode(chIcon) + + self.bypassExit = False + self.cbServiceCommand(('docommand',self.doCommand)) + + def doCommand(self, cmd): + if cmd == 'bypass_exit': + self.bypassExit = True + + def cbDrawChannelIcon(self, picInfo=None): + ptr = self.picload.getData() + if ptr != None: + self["channel_icon"].instance.setPixmap(ptr.__deref__()) + self["channel_icon"].show() + + def __onClose(self): + self.session.nav.stopService() + + def __seekableStatusChanged(self): + service = self.session.nav.getCurrentService() + if service is not None: + seek = service.seek() + if seek is None or not seek.isCurrentlySeekable(): + self.setSeekState(self.PLAYER_PLAYING) + + def __serviceStarted(self): + self.state = self.PLAYER_PLAYING + self.__seekableStatusChanged() + + def __evEOF(self): + if self.bypassExit: + return + self.doExit() + + def __setHideTimer(self): + self.hidetimer.start(5000) + + def doExit(self): + list = ((_("Yes"), "y"), (_("No"), "n"),) + self.session.openWithCallback(self.cbDoExit, ChoiceBox, title=_("Stop playing this stream?"), list=list) + + def cbDoExit(self, answer): + answer = answer and answer[1] + if answer == "y": + self.cbServiceCommand() + self.close() + + def setSeekState(self, wantstate): + service = self.session.nav.getCurrentService() + if service is None: + print "No Service found" + return + + pauseable = service.pause() + if pauseable is not None: + if wantstate == self.PLAYER_PAUSED: + pauseable.pause() + self.state = self.PLAYER_PAUSED + if not self.shown: + self.hidetimer.stop() + self.show() + elif wantstate == self.PLAYER_PLAYING: + pauseable.unpause() + self.state = self.PLAYER_PLAYING + if self.shown: + self.__setHideTimer() + else: + self.state = self.PLAYER_PLAYING + + def doInfoAction(self): + if self.shown: + self.hidetimer.stop() + self.hide() + else: + self.show() + if self.state == self.PLAYER_PLAYING: + self.__setHideTimer() + + def doPlay(self): + if self.state == self.PLAYER_PAUSED: + if self.shown: + self.__setHideTimer() + self.state = self.PLAYER_PLAYING + self.session.nav.playService(self.service) + if self.shown: + self.__setHideTimer() + + def playpauseService(self): + if self.state == self.PLAYER_PLAYING: + self.setSeekState(self.PLAYER_PAUSED) + elif self.state == self.PLAYER_PAUSED: + self.setSeekState(self.PLAYER_PLAYING) + +class StreamURIParser: + def __init__(self, xml): + self.xml = xml + + def parseStreamList(self): + tvlist = [] + tree = ElementTree() + tree.parse(self.xml) + + for iptv in tree.findall('iptv'): + n = str(iptv.findtext('name')) + i = str(iptv.findtext('icon')) + u = str(iptv.findtext('uri')) + t = str(iptv.findtext('type')) + tvlist.append({'name':n, 'icon':i, 'type':t, 'uri':self.parseStreamURI(u)}) + return tvlist + + def parseStreamURI(self, uri): + uriInfo = {} + splitedURI = uri.split() + uriInfo['URL'] = splitedURI[0] + for x in splitedURI[1:]: + i = x.find('=') + uriInfo[x[:i].upper()] = str(x[i+1:]) + return uriInfo + +def streamListEntry(entry): + #print entry + uriInfo = entry[1].get('uri') + return [entry, + (eListboxPythonMultiContent.TYPE_PIXMAP_ALPHATEST, 5, 1, 35, 35, loadPNG('%s/icons/%s' % (PLUGIN_PATH, str(entry[1].get('icon'))) )), + (eListboxPythonMultiContent.TYPE_TEXT,45,7,200,37,0,RT_HALIGN_LEFT,entry[0]), + (eListboxPythonMultiContent.TYPE_TEXT,250,7,310,37,1,RT_HALIGN_LEFT,str(uriInfo.get('URL'))) + ] + +class StreamTVList(Screen): + skin = """ + + + + """ + def __init__(self, session): + self.session = session + Screen.__init__(self, session) + self["actions"] = ActionMap(["OkCancelActions", "ShortcutActions", "WizardActions", "ColorActions", "SetupActions", "NumberActions", "MenuActions"], { + "ok" : self.keyOK, + "cancel": self.keyCancel, + "up" : self.keyUp, + "down" : self.keyDown, + "left" : self.keyLeft, + "right" : self.keyRight, + }, -1) + + self.streamBin = resolveFilename(SCOPE_PLUGINS, "Extensions/StreamTV/rtmpdump") + self.streamFile = resolveFilename(SCOPE_PLUGINS, "Extensions/StreamTV/stream.xml") + + self.streamList = [] + self.makeStreamList() + + self.streamMenuList = MenuList([], enableWrapAround=True, content=eListboxPythonMultiContent) + self.streamMenuList.l.setFont(0, gFont('Regular', 22)) + self.streamMenuList.l.setFont(1, gFont('Regular', 18)) + self.streamMenuList.l.setItemHeight(37) + self['streamlist'] = self.streamMenuList + self.streamMenuList.setList(map(streamListEntry, self.streamList)) + + self.onLayoutFinish.append(self.layoutFinished) + + self.rtmpConsole = None + self.beforeService = None + self.currentService = None + self.playerStoped = False + self.serviceDoCommand = None + + self.keyLocked = False + + def layoutFinished(self): + rc = os.popen('ps -ef | grep rtmpdump | grep -v grep').read() + print "a process already running :", rc + if rc is not None: + if rc.strip() != '': + os.system('killall -INT rtmpdump') + def keyLeft(self): + if self.keyLocked: + return + self['streamlist'].pageUp() + + def keyRight(self): + if self.keyLocked: + return + self['streamlist'].pageDown() + + def keyUp(self): + if self.keyLocked: + return + self['streamlist'].up() + + def keyDown(self): + if self.keyLocked: + return + self['streamlist'].down() + + def keyCancel(self): + self.cbAppClosed(True) + self.close() + + def keyOK(self): + if self.keyLocked: + return + self.keyLocked = True + self.rtmpConsole = None + self.beforeService = None + self.currentService = None + self.playerStoped = False + self.serviceDoCommand = None + + streamInfo = self["streamlist"].getCurrent()[0][1] + uriInfo = streamInfo.get('uri') + typeInfo = streamInfo.get('type').split(':') + + protocol = typeInfo[0] + url = uriInfo.get('URL') + if protocol == 'rtmp': + self.layoutFinished() + self.rtmpConsole = eConsoleAppContainer() + self.rtmpConsole.dataAvail.append(self.cbDataAvail) + self.rtmpConsole.appClosed.append(self.cbAppClosed) + self.rtmpConsole.execute(self.makeCommand(uriInfo)) + elif protocol in ('rtsp', 'http', 'hls'): + serviceType = typeInfo[1] + bufferSize = typeInfo[2] + self.doStreamAction(url, serviceType, bufferSize) + + def doStreamAction(self, url=None, serviceType='4097', bufferSize=None): + if url is None: + url='/tmp/stream.avi' + self.streamPlayerTimer.stop() + #if os.path.exists(url): + # os.unlink(url) + try: + serviceType = int(serviceType) + except: serviceType = 4097 + try: + bufferSize = int(bufferSize) + except: bufferSize = None + + service = eServiceReference(serviceType, 0, url) + #if bufferSize is not None: + # service.setData(2, bufferSize*1024) + + streamInfo = self["streamlist"].getCurrent()[0][1] + uriInfo = streamInfo.get('uri') + self.beforeService = self.session.nav.getCurrentlyPlayingServiceReference() + self.currentService = self.session.openWithCallback(self.cbFinishedStream, + StreamTVPlayer, + service, + cbServiceCommand=self.cbServiceCommand, + chName=str(streamInfo.get('name')), + chURL =str(uriInfo.get('URL')), + chIcon=str(streamInfo.get('icon'))) + + def cbServiceCommand(self, params=None): + if params is None: + self.playerStoped = True + return + if params[0] == 'docommand': + self.serviceDoCommand = params[1] + + def cbAppClosed(self, ret): + print ret + self.doConsoleStop() + if self.currentService is not None and not self.playerStoped: + self.serviceDoCommand('bypass_exit') + message = "The connection was terminated from the stream server." + self.session.open(MessageBox, message, type=MessageBox.TYPE_INFO) + self.currentService.close() + self.currentService = None + self.serviceDoCommand = None + + def cbDataAvail(self, data): + print data + if str(data) == 'Connected...': + self.streamPlayerTimer = eTimer() + self.streamPlayerTimer.timeout.get().append(self.doStreamAction) + self.streamPlayerTimer.start(1000) + + def cbFinishedStream(self): + self.doConsoleStop() + print 'done!!' + + def doConsoleStop(self): + self.keyLocked = False + if self.rtmpConsole is not None: + self.rtmpConsole.sendCtrlC() + self.rtmpConsole = None + + def makeCommand(self, uriInfo): + def appendCommand(key, option): + try: + d = uriInfo.get(key) + if d is not None: + return "-%s %s " %(option, d) + except: pass + return '' + command = '%s -v ' % (self.streamBin) + command += appendCommand('URL', 'r') + command += appendCommand('PLAYPATH', 'y') + command += appendCommand('SWFURL', 'W') + return command + + def makeStreamList(self): + streamDB = StreamURIParser(self.streamFile).parseStreamList() + self.streamList = [] + for x in streamDB: + self.streamList.append((x.get('name'), x)) + +def main(session, **kwargs): + session.open(StreamTVList) + +def Plugins(**kwargs): + return PluginDescriptor(name=_("StreamTVPalyer"), description="Watching IPTV implemented by RTSP/RTMP protocol.", where = PluginDescriptor.WHERE_PLUGINMENU, fnc=main) + + diff --git a/lib/python/Plugins/Extensions/StreamTV/rtmpdump b/lib/python/Plugins/Extensions/StreamTV/rtmpdump new file mode 100644 index 0000000..0b845b5 Binary files /dev/null and b/lib/python/Plugins/Extensions/StreamTV/rtmpdump differ diff --git a/lib/python/Plugins/Extensions/StreamTV/stream.xml b/lib/python/Plugins/Extensions/StreamTV/stream.xml new file mode 100644 index 0000000..eb067f2 --- /dev/null +++ b/lib/python/Plugins/Extensions/StreamTV/stream.xml @@ -0,0 +1,311 @@ + + + + ALFA + alfa.png + rtsp:4097:512 + rtsp://fms.zulu.mk/zulu/alfa_1 + + + MTB1 + default.png + rtsp:4097:512 + rtsp://fms.zulu.mk/zulu/mtv1_1 + + + A2 + default.png + rtsp:4097:512 + rtsp://fms.zulu.mk/zulu/a2_1 + + + KANAL5 + kanal5.png + rtsp:4097:512 + rtsp://fms.zulu.mk/zulu/kanal5_1 + + + TELMA + telma.png + rtsp:4097:512 + rtsp://fms.zulu.mk/zulu/telma_1 + + + HAWATB + default.png + rtsp:4097:512 + rtsp://fms.zulu.mk/zulu/nasatv_1 + + + ALSAT + alsat.png + rtsp:4097:512 + rtsp://fms.zulu.mk/zulu/alsat_1 + + + SITEL3 + sitel3.png + rtsp:4097:512 + rtsp://fms.zulu.mk/zulu/sitel3_1 + + + KANAL5+ + kanal5.png + rtsp:4097:512 + rtsp://fms.zulu.mk/zulu/kanal5plus_1 + + + BTR + btr.png + rtsp:4097:512 + rtsp://fms.zulu.mk/zulu/btr_1 + + + HDextreme + hdextreme.png + rtsp:4097:512 + rtsp://hdimages.cdnvideo.ru/rr/HDextremeCDN + + + HDprocess + hdprocess.png + rtsp:4097:512 + rtsp://hdimages.cdnvideo.ru/rr/HDprocessCDN + + + HDtravel + hdtravel.png + rtsp:4097:512 + rtsp://hdimages.cdnvideo.ru/rr/HDtravelCDN + + + NOVA + nova.png + rtsp:4097:512 + rtsp://94.156.248.42/nova_live_q1.wmv/video;seq=34017;rtptime=0 + + + REDUTA + reduta.png + rtsp:4097:512 + rtsp://s1.media-planet.sk/live/reduta + + + TV Biznes (Польша) + tvbiznes.png + http:4097:512 + http://193.111.38.242/streams/o2/TVBiznes/TVbiznes.livx + + + ORT+2 TV + ort.png + rtsp:4097:512 + rtsp://iptv.karelia.ru/ort.sdp + + + K1 + k1.png + rtsp:4097:512 + rtsp://62.149.26.237:1935/tv/_definst_/k1 + + + Euronews + euronews.png + rtsp:4097:512 + rtsp://iptv.karelia.ru/euro.sdp + + + shaber2 + shaber.png + rtsp:4097:512 + rtsp://media2.kure.tv:1935/live/shaber2 + + + yumurcak2 + yumurcak.png + rtsp:4097:512 + rtsp://media2.kure.tv:1935/live/yumurcak2 + + + inter + intertv.png + rtsp:4097:512 + rtsp://62.149.26.237:1935/tv/_definst_/inter + + + eUroticTV + urotictv.png + hls:4097: + http://174.121.228.234/hls-live/livepkgr/_definst_/liveevent/etv-livestream_2.m3u86 + + + BBC World News + bbcworldnews.png + rtmp:4097: + rtmp://media2.lsops.net/live/ playpath=bbcworld1_en_high.sdp swfUrl=http://www.livestation.com/flash/player/5.4/player.swf pageUrl=http://www.livestation.com/channels/66-cnn-international swfVfy=true live=true + + + Euro Sport + eurosport.png + rtmp:4097: + rtmp://cp108478.live.edgefcs.net/live playpath=eurosport_1_800@45515 swfURL=http://www.wilmaa.com/player/main_v3.334.swf swfVfy=true live=true + + + + Bloomberg TV + bloombergtv.png + rtmp:4097: + rtmpt://cp87869.live.edgefcs.net:1935/live/ playpath=us_300@21006 swfURL=http://cdn.gotraffic.net/v/20110210_153738//flash/BloombergMediaPlayer.swf + + + Legend + legend.png + rtmp:4097: + rtmp://fms.105.net:1935/live/ swfurl=http://www.freeetv.com/modules/Video_Stream/plugins/akaim/liveplayer.swf playpath=legend1 live=true + + + Playme + playme.png + rtmp:4097: + rtmp://cp107974.live.edgefcs.net/live/ playpath=beep-flash-live@34654 live=true + + + Sky TG24 + skytg24.png + rtmp:4097: + rtmp://cp49989.live.edgefcs.net/live/ swfurl=http://www.freeetv.com/modules/Video_Stream/plugins/akaim/liveplayer.swf playpath=streamRM1@2564 live=true + + + + Italy TV + italytv.png + rtmp:4097: + rtmp://fms.105.net:1935/live playpath=italytv1 + + + Radio105 TV + radio105.png + rtmp:4097: + rtmp://fms.105.net:1935/live playpath=105Test1 + + + For Music + formusic.png + rtmp:4097: + rtmp://wowza1.top-ix.org/quartaretetv1 playpath=formusicweb + + + Radio Montecarlo + radiomontecarlo.png + rtmp:4097: + rtmp://fms.105.net:1935/live playpath=rmc1 + + + Top40 + ustop40.png + rtmp:4097: + rtmp://fms.105.net:1935/live playpath=charts1 + + + BBC Persian + bbcpersian.png + rtmp:4097: + rtmp://media2.lsops.net/bbc playpath=ptv_live@3585 swfUrl=http://www.livestation.com/flash/player/5.4/player.swf pageUrl=http://www.livestation.com/channels/71-bbc-persian-tv-persian swfVfy=true live=true + + + Euro News-UK + euronews_uk.png + rtmp:4097: + rtmp://media2.lsops.net/live/ playpath=euronews_es_high.sdp swfUrl=http://www.livestation.com/flash/player/5.4/player.swf swfVfy=true live=true + + + UNIP Brasil + unipbrasil.png + rtmp:4097: + rtmp://67.228.212.5/ponto38/mixtv swfUrl=http://www.assistatvonline.com/fucku2.swf pageUrl=http://www.assistatvonline.com/canais/mixtv.php live=true + + + SIC Noticias + sicnoticias.png + rtmp:4097: + rtmp://213.13.26.12/live/sicnoticias.flv swfUrl=http://www.tvdez.com/player2.swf pageURL=http://www.tvdez.com/sicnoticias swfVfy=true live=true + + + Fresh TV + freshtv.png + rtmp:4097: + rtmp://www.planeta-online.tv:1936/live playpath=channel_4 swfUrl=http://www.planeta-online.tv/planeta_player.swf?ver=1345585527 pageUrl=http://www.planeta-online.tv/?ch=4 live=true + + + Premiere TV-RU + premieretvru.png + rtmp:4097: + rtmp://www.planeta-online.tv:1936/live playpath=channel_5 swfUrl=http://www.planeta-online.tv/planeta_player.swf?ver=1110761474 pageUrl=http://www.planeta-online.tv/?ch=5 live=true + + + PikTV.com + piktvcom.png + rtmp:4097: + rtmp://wms002.pik-tv.com/live/ playpath=piktv3pik3tv swfUrl=http://pik-tv.com/players/uppod/uppod.swf pageUrl=http://pik-tv.com/ live=true + + + Rusia Today + rusiatoday.png + rtmp:4097: + rtmp://rt.fms.visionip.tv/live/ app=live swfUrl=http://actualidad.rt.com/swf/player.swf pageUrl=http://actualidad.rt.com/mas/envivo/ playpath=RT_Spanish_3 live=true swfVfy=true + + + Barb2 + barb2.png + rtmp:4097: + rtmp://www.planeta-online.tv:1936/live playpath=channel_6 swfUrl=http://www.planeta-online.tv/planeta_player.swf?ver=2095379291 pageUrl=http://www.planeta-online.tv/?ch=6 live=true + + + Antenna Latina + antennalatina.png + rtmp:4097: + rtmp://mek2.mekstream.com/antenalatina playpath=live3 swfUrl=http://www.mekstream.com/clients/antenalatina/player-licensed.swf pageUrl=http://www.antenalatina7.com/streaming7/str.html swfVfy=true live=true + + + Teltemadrid Sat + teltemadridsat.png + rtmp:4097: + rtmp://cp118140.live.edgefcs.net/live/ playpath=TSAtelemadridsat@47720 swfUrl=http://jonas.do.am/player.swf pageUrl=http://jonas.do.am swfVfy=true live=true + + + InterEconomia.biz + intereconomiabiz.png + rtmp:4097: + rtmp://media.intereconomia.com/live/business1 + + + Kontra Channel + kontrachannel.png + rtmp:4097: + rtmp://flashcloud.mediacdn.com/live/kontratv swfUrl=http://wwitv.com/player/player15.swf pageURL=http://www.kontrachannel.gr/ swfVfy=true live=true + + + NHK World + nhkworld.png + rtmp:4097: + rtmp://ny-1.net.fivecool.org/2e2cd/ pageUrl=http://www3.nhk.or.jp/ swfUrl=http://www3.nhk.or.jp/nhkworld/r/movie/streamhub_player_20110429.swf Playpath=nhkworldglobalhigh1.sdp + + + HGTV + hgtv.png + rtmp:4097: + rtmp://fms3.tikilive.com:1935/view/25503_122/stream25503 + + + Nasa HD + nasahd.png + rtmp:4097: + rtmp://cp76072.live.edgefcs.net/live/ pageUrl=http://www.nasa.gov/multimedia/nasatv/media_flash.html swfUrl=http://www.nasa.gov/templateimages/redesign/flash_player/swf/4.5/player.swf Playpath=MED-HQ-Flash@42814 live=true + + + Sun News + sunnews.png + rtmp:4097: + rtmp://cp39414.live.edgefcs.net/live/argent@9751 swfUrl=http://www.freeetv.com/modules/Video_Stream/plugins/akaim/liveplayer.swf + +