Video Title

Optional video title
Hi guys!

Last update got some really nice things! Great work! :)

In my plugin I got a few WebVideoItem's with some special names, ie "Watch Preview" (which lets the user watch a preview of the selected movie), and "Watch Movie" with subtitles like "Rental period: 23h 50m". This looks all nice and all in the menu interface, however when the actual movie starts to play, it looks kindof boring with "Watch Preview" as title when you for example press Pause.

I've been diggin through the available sources, ie Plex, and I found that cores/pmsplayer/PlexMediaServerPlayer.cpp receives a TITLE command, although I have no idea what that is doing (haven't familiarized myself too much with Plex yet).. Or what is feed into that line (until someone decides to open PMS sources.. ;)) Any hints? :)

Another place I've looked is xbmc/FileSystem/PlexDirectory.cpp and PlexMediaVideo::DoBuildFileItem, maybe one could add a few extra attributes ie realTitle or something, which then is used.. Hm hm just throwing ideas around, I guess I should get my build env finished and do some testing instead :)

Anyways, as I said, great work with the last release! :)

I realize that I'm probably going deeper than the average plugin developer here, but I hope someone can shed some light or give some ideas anyway :)
Thanks!

The magic source file that deals with media server content is PlexDirectory.cpp (as you’ve already found :)). This converts the XML responses from the media server to CFileItem objects compatible with the rest of XBMC-land. There’s also some additional hackery in the CFileItem and CGUIWindow classes (particularly CGUIMediaWindow) to handle the extra attributes the media server can provide (like message containers & popup menus).



Unfortunately, I’m 99% sure that what you’re trying to do won’t be possible without modifications to the Plex (XBMC) source. I think that the OSD in the player pulls this information from the CFileItem instance selected for playback from a media window. To get a separate title when playing, we’d have to bolt on an extra variable & make sure it was passed around correctly. It’s definitely an interesting idea though, and I can see it benefiting a lot of plug-in developers. I’m working on the v1.1 update to the framework at the moment, so I’ll work it in if possible :slight_smile: Have you had any thoughts on what the syntax in the plug-in code would look like? Would an extra attribute in the media item constructor do it?

Hi Jam, thanks for your response!



Yeah, I’m pretty sure it would involve modifying the Plex source. Do you mean that this is a problem? Might be a bad thing in terms of keeping it upstream code mergable, but I guess you have to sacrifice in order to be able to improve (as I’m sure you’ve done all over the place already:)).



For a possible solution, yeah an extra attribute to the item would work perfect!



Some code from my “confirmPlay” which shows inside a popupmenu


def confirmPlay(sender, id):<br />
		content = HWAPI.content(id)<br />
<br />
		# Inside a PopupDirectoryItem<br />
		dir = MediaContainer()<br />
		dir.replaceParent = True<br />
		dir.nocache = True<br />
		dir.title2=_L('content_ConfirmPlayTitle') %content.name<br />
<br />
		# Yes we will get a fuckedup title on the stream... But not now since we are introducing videoTitle! :)<br />
		wvi = WebVideoItem(<br />
						HWAPI.videoUrl(content.stream),<br />
						title=_L('content_ConfirmPlayYes'),<br />
						videoTitle=content.title<br />
						)<br />
		dir.Append(wvi)<br />
<br />
		# Cancel, back to content<br />
		dir.Append(Function(<br />
				DirectoryItem(handlePopupCancel,<br />
						title = _L('content_ConfirmPlayNo')))<br />
				)<br />
<br />
		# Have to reset regardless if the user started playing or not..<br />
		HWAPI.resetOwned()<br />
		return dir



Something like that? videoTitle would override title when the actual video is played, but in the menu the normal title item is used. I'm not sure if the videoItem makes use of subtitle/summary, but if it does then those could be overridden in the same way.

On a completly different note.. In the above code I'm using nocache & replaceParent.. which actually would be wrong for a popupmenu (why would i wanna replace parent).. But the noHistory does not seem to work? I had a bunch of wierd problems with this, any ideas if noHistory is supposed to work?


Anyhow, a fix for this would be great, looking forward to it! :)

Thanks
Johan

have you tried just putting the full title you want in the the subtitle or summary arguments for the videoitem? in my experience they work well and show up on the pause screen and you can set a view mode that will hide them when you’re in the menu.



Hm, nope that does not seem to work here. only title is showed, neither subtitle or summary is used anywhere?


Jam: If you did make any changes to the Plex/XBMC source, is there any possibility to add an option for the plugin to toggle SetCanQueue (this is for all types of items) too? Pressing Q in my plugin is kindof dangerous while it recurses down my menys and "clicking" the "Rent movie" followed by "Confirm" all way through..

And for any swedish readers (or anyone want to look at a video of the beta) [http://mac.feber.se/art/164018/hyr_film_enkelt_i_plex/](http://mac.feber.se/art/164018/hyr_film_enkelt_i_plex/) :)

Cheers!

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.