Channel straight to video

Hi guys, I'm trying to develop a plugin using the TWiT plugin as a template.

 

Basically I'm going to be streaming video the same way as the TWiT app does (the Watch Live), and have deleted all the references to the pre-recorded shows, which leaves just the Watch Live button.

 

However, I'd like it so that as opposed to the following routine to watch the actual video:

 

1. Go to Plex Main Screen

2. Select Channels

3. Select TWiT.tv Channel

4. Select Watch TWiT Live

5. Click Watch TWiT Live button

6. Video streams

 

I'd like it to be able to skip 4 and 5

 

So ideally it would be:

 

1. Go to Plex Main Screen

2. Select Channels

3. Select TWiT.tv Channel

4. Video streams

 

Here's the code I've managed to get it down to thus far:

 

 

SHOWS_XML = "http://static.twit.tv/ShiftKeySoftware/rssFeeds.plist"

ITUNES_NAMESPACE = {'itunes':'http://www.itunes.com/dtds/podcast-1.0.dtd'}
LIVE_URLS = {
}
 
 
HLS_COMPAT = ('iOS', 'Android', 'Roku', 'Safari', 'MacOSX', 'Windows', 'Plex Home Theater')
 
####################################################################################################
def Start():
 
ObjectContainer.title1 = "TWiT.TV"
HTTP.CacheTime = CACHE_1HOUR
 
####################################################################################################
@handler('/video/twittv', "TWiT.TV")
def MainMenu():
 
oc = ObjectContainer(no_cache=True)
 
# Add TWiT Live entry
if Client.Platform in HLS_COMPAT:
oc.add(LiveStream(hls_provider=Prefs['hls_provider']))
 
return oc
 
####################################################################################################
def LiveStream(hls_provider='Ustream', include_container=False):
 
vco = VideoClipObject(
key = Callback(LiveStream, hls_provider=hls_provider, include_container=True),
rating_key = LIVE_URLS[hls_provider],
title = 'Watch TWiT Live',
thumb = R('icon-twitlive.png'),
items = [
MediaObject(
video_resolution = 'sd',
parts = [
PartObject(key=HTTPLiveStreamURL(LIVE_URLS[hls_provider]))
]
)
]
)
 
if include_container:
return ObjectContainer(objects=[vco])
else:
return vco
 

 

 

Any suggestions on what to delete?

 

Thanks in advanced for any help!

You could try to return your VideoClipObject directly from the main menu:

def MainMenu():
    return LiveStream(hls_provider=Prefs['hls_provider'], include_container=True)

But I don't think that will make it play straight away.

Though if you use Plex Home Theater you can hit "P" key which will skip the usual video detail screen and go straight to playing. Other clients may have similar function.

Most clients require that you to have a separate function for creating the VideoClipObject() with your media, so it will build the play screen. I think the Roku is the only client that will work if you do not create a separate function for it (I know PHT and PlexWeb will not work without it). See https://forums.plex.tv/topic/131938-having-problem-with-playing-video/?p=793470

This one is a good basic example of a CreateVideoObject() function:

https://github.com/plexinc-plugins/Tagesschau.bundle/blob/master/Contents/Code/__init__.py#L31

This one is a little more complex. It shows an example of one for an HLS stream and pulls more data :

https://github.com/sander1/BijlageTV.bundle/blob/802120912b1c45cf5cc39a7dfdcf5eee26403be7/Contents/Code/__init__.py

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