2020-03-27, 02:08
I have a video add-on that calls DisplayVideoInfo.xml via a context menu add command:
li.addContextMenuItems([ (addon.getLocalizedString(30347), 'Container.Refresh'), (addon.getLocalizedString(30346), 'Action(ParentDir)'), (addon.getLocalizedString(30348), 'XBMC.Action(Info)') ])
I am having difficulty passing the image info (in this case I am testing with the Confluence skin) to the Actor image control in the DisplayVideoInfo.xml file. Specifically:
<control type="image">
<description>Actor image</description>
<left>210</left>
<top>480</top>
<width>160</width>
<height>160</height>
<texture>$INFO[Container(50).Listitem.Icon]</texture>
<aspectratio>keep</aspectratio>
<visible>Control.IsVisible(50)</visible>
</control>
If I change the texture parameter to a hard coded file name I get the image so I know the basic skin functionality is working as I want. I am passing the DisplayVideoInfo.xml the rest of the parameters in the video info window just fine via the following code in my add-on:
if mediaClass_text == 'video':
li.addContextMenuItems([ (addon.getLocalizedString(30347), 'Container.Refresh'), (addon.getLocalizedString(30346), 'Action(ParentDir)'), (addon.getLocalizedString(30348), 'XBMC.Action(Info)') ])
info = {
# 'id': '1234',
'duration': getSeconds(duration_text),
'genre': genre_text,
'year': release_year_text,
'title': title,
'plot': description_text,
'director': creator_text,
'tagline': tagline_text,
'writer': writer_text,
'cast': artist_text.split(','),
'artist': artist_text.split(','),
'rating': rating_val,
'code': imdb_text,
'mediatype': categories_text.split(','),
'season': season_text,
'episode': episode_text,
'lastplayed': lastplayed_text,
'aired': aired_text,
'mpaa':content_rating_text,
'playcount':playcount,
'trailer':trailerurl,
'icon':'d:\gbutler.jpg',
}
li.setInfo(mediaClass_text, info)
li.setProperty('ResumeTime', dcmInfo_text)
li.setProperty('TotalTime', str(getSeconds(duration_text)))
video_info = {
'codec': video_codec_text,
'aspect': aspect,
'width': video_width,
'height': video_height,
}
li.addStreamInfo('video', video_info)
li.addStreamInfo('audio', {'codec': audio_codec_text, 'language': audio_lang, 'channels': int(audio_channels_text)})
li.addStreamInfo('subtitle', {'language': subtitle_lang})
I tried hard coding the red text above for testing but passing the icon variable is not supported this way according to: http://mirrors.kodi.tv/docs/python-docs/...em-setInfo
And the logs confirm it:
2020-03-26 19:51:47.544 T:34480 ERROR: NEWADDON Unknown Video Info Key "icon"
Can someone point me in the right direction here ? I want to pass a list of URLs which point to files on my uPNP server to populate the <texture>$INFO[Container(50).Listitem.Icon]</texture> skin element. I know I am missing something simple here but just can't see it.
Thanks in advance,
Jeff
li.addContextMenuItems([ (addon.getLocalizedString(30347), 'Container.Refresh'), (addon.getLocalizedString(30346), 'Action(ParentDir)'), (addon.getLocalizedString(30348), 'XBMC.Action(Info)') ])
I am having difficulty passing the image info (in this case I am testing with the Confluence skin) to the Actor image control in the DisplayVideoInfo.xml file. Specifically:
<control type="image">
<description>Actor image</description>
<left>210</left>
<top>480</top>
<width>160</width>
<height>160</height>
<texture>$INFO[Container(50).Listitem.Icon]</texture>
<aspectratio>keep</aspectratio>
<visible>Control.IsVisible(50)</visible>
</control>
If I change the texture parameter to a hard coded file name I get the image so I know the basic skin functionality is working as I want. I am passing the DisplayVideoInfo.xml the rest of the parameters in the video info window just fine via the following code in my add-on:
if mediaClass_text == 'video':
li.addContextMenuItems([ (addon.getLocalizedString(30347), 'Container.Refresh'), (addon.getLocalizedString(30346), 'Action(ParentDir)'), (addon.getLocalizedString(30348), 'XBMC.Action(Info)') ])
info = {
# 'id': '1234',
'duration': getSeconds(duration_text),
'genre': genre_text,
'year': release_year_text,
'title': title,
'plot': description_text,
'director': creator_text,
'tagline': tagline_text,
'writer': writer_text,
'cast': artist_text.split(','),
'artist': artist_text.split(','),
'rating': rating_val,
'code': imdb_text,
'mediatype': categories_text.split(','),
'season': season_text,
'episode': episode_text,
'lastplayed': lastplayed_text,
'aired': aired_text,
'mpaa':content_rating_text,
'playcount':playcount,
'trailer':trailerurl,
'icon':'d:\gbutler.jpg',
}
li.setInfo(mediaClass_text, info)
li.setProperty('ResumeTime', dcmInfo_text)
li.setProperty('TotalTime', str(getSeconds(duration_text)))
video_info = {
'codec': video_codec_text,
'aspect': aspect,
'width': video_width,
'height': video_height,
}
li.addStreamInfo('video', video_info)
li.addStreamInfo('audio', {'codec': audio_codec_text, 'language': audio_lang, 'channels': int(audio_channels_text)})
li.addStreamInfo('subtitle', {'language': subtitle_lang})
I tried hard coding the red text above for testing but passing the icon variable is not supported this way according to: http://mirrors.kodi.tv/docs/python-docs/...em-setInfo
And the logs confirm it:
2020-03-26 19:51:47.544 T:34480 ERROR: NEWADDON Unknown Video Info Key "icon"
Can someone point me in the right direction here ? I want to pass a list of URLs which point to files on my uPNP server to populate the <texture>$INFO[Container(50).Listitem.Icon]</texture> skin element. I know I am missing something simple here but just can't see it.
Thanks in advance,
Jeff