2015-03-13 21:24:59 +00:00
|
|
|
import xbmcaddon
|
|
|
|
import xbmcplugin
|
|
|
|
import xbmc
|
|
|
|
import xbmcgui
|
|
|
|
import os
|
|
|
|
import threading
|
|
|
|
import json
|
|
|
|
import urllib
|
|
|
|
|
2015-03-25 17:37:21 +00:00
|
|
|
addonSettings = xbmcaddon.Addon(id='plugin.video.emby')
|
2015-03-13 21:24:59 +00:00
|
|
|
cwd = addonSettings.getAddonInfo('path')
|
|
|
|
BASE_RESOURCE_PATH = xbmc.translatePath( os.path.join( cwd, 'resources', 'lib' ) )
|
|
|
|
sys.path.append(BASE_RESOURCE_PATH)
|
|
|
|
|
|
|
|
WINDOW = xbmcgui.Window( 10000 )
|
|
|
|
|
|
|
|
import Utils as utils
|
|
|
|
from PlaybackUtils import PlaybackUtils
|
|
|
|
|
2015-04-02 19:47:06 +00:00
|
|
|
try:
|
|
|
|
params=utils.get_params(sys.argv[2])
|
|
|
|
mode = params.get('mode',"")
|
|
|
|
id = params.get('id',"")
|
|
|
|
except:
|
|
|
|
params={}
|
|
|
|
mode=None
|
|
|
|
id=None
|
2015-03-18 17:54:30 +00:00
|
|
|
|
2015-04-02 19:47:06 +00:00
|
|
|
if mode != None and mode == "play":
|
2015-05-02 16:36:06 +00:00
|
|
|
listItem = xbmcgui.ListItem(path="")
|
|
|
|
xbmcplugin.setResolvedUrl (int(sys.argv[1]), True, listItem)
|
2015-05-02 15:49:29 +00:00
|
|
|
WINDOW.setProperty('GUIPLAY', str(id)) # set window prop
|
2015-04-02 19:47:06 +00:00
|
|
|
elif sys.argv[1] == "reset":
|
|
|
|
utils.reset()
|
2015-03-18 17:54:30 +00:00
|
|
|
else:
|
2015-03-25 17:37:21 +00:00
|
|
|
xbmc.executebuiltin('Addon.OpenSettings(plugin.video.emby)')
|
2015-03-13 21:24:59 +00:00
|
|
|
|