# Channel straight to video

**URL:** <https://forums.plex.tv/t/channel-straight-to-video/88593>\
**Category:** Dev/API Corner\
**Tags:** plugin-dev\
**Created:** [January 2, 2015, 9:03pm UTC](https://forums.plex.tv/t/channel-straight-to-video/88593 "2015-01-02T21:03:55Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![saschalopez](https://avatars.discourse-cdn.com/v4/letter/s/b19c9b/32.png) [@saschalopez](https://forums.plex.tv/u/saschalopez)\
**Post date:** [January 2, 2015, 9:03pm UTC](https://forums.plex.tv/t/channel-straight-to-video/88593/1 "2015-01-02T21:03:55Z")

</div>

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

&nbsp;

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.

&nbsp;

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

&nbsp;

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

&nbsp;

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

&nbsp;

So ideally it would be:

&nbsp;

1. Go to Plex Main Screen

2. Select Channels

3. Select TWiT.tv Channel

4. Video streams

&nbsp;

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

&nbsp;

> &nbsp;
> 
> SHOWS\_XML = "[http://static.twit.tv/ShiftKeySoftware/rssFeeds.plist"](http://static.twit.tv/ShiftKeySoftware/rssFeeds.plist)
> 
> ITUNES\_NAMESPACE = {'itunes':'[http://www.itunes.com/dtds/podcast-1.0.dtd'}](http://www.itunes.com/dtds/podcast-1.0.dtd%27%7D)
> 
> COVER\_URL = "[http://leoville.tv/podcasts/coverart/%s600%s.jpg"](http://leoville.tv/podcasts/coverart/%25s600%25s.jpg)
> 
> LIVE\_URLS = {
> 
> 'BitGravity 400 Kbps': '[http://twit.live-s.cdn.bitgravity.com/cdn-live-s1/\_definst\_/twit/live/low/playlist.m3u8'](http://twit.live-s.cdn.bitgravity.com/cdn-live-s1/_definst_/twit/live/low/playlist.m3u8%27)
> 
> 'BitGravity 1 Mbps': '[http://twit.live-s.cdn.bitgravity.com/cdn-live-s1/\_definst\_/twit/live/high/playlist.m3u8'](http://twit.live-s.cdn.bitgravity.com/cdn-live-s1/_definst_/twit/live/high/playlist.m3u8%27)
> 
> 'Ustream': '[http://iphone-streaming.ustream.tv/ustreamVideo/1524/streams/live/playlist.m3u8'](http://iphone-streaming.ustream.tv/ustreamVideo/1524/streams/live/playlist.m3u8%27)
> 
> 'Justin.tv': '[http://usher.justin.tv/stream/multi\_playlist/twit.m3u8'](http://usher.justin.tv/stream/multi_playlist/twit.m3u8%27)
> 
> 'Flosoft.biz': '[http://hls.twit.tv:1935/flosoft/smil:twitStream.smil/playlist.m3u8'](http://hls.twit.tv:1935/flosoft/smil:twitStream.smil/playlist.m3u8%27)
> 
> }
> 
> &nbsp;
> 
> &nbsp;
> 
> HLS\_COMPAT = ('iOS', 'Android', 'Roku', 'Safari', 'MacOSX', 'Windows', 'Plex Home Theater')
> 
> &nbsp;
> 
> ####################################################################################################
> 
> def Start():
> 
> &nbsp;
> 
> ObjectContainer.title1 = "TWiT.TV"
> 
> HTTP.CacheTime = CACHE\_1HOUR
> 
> &nbsp;
> 
> ####################################################################################################
> 
> @handler('/video/twittv', "TWiT.TV")
> 
> def MainMenu():
> 
> &nbsp;
> 
> oc = ObjectContainer(no\_cache=True)
> 
> &nbsp;
> 
> # Add TWiT Live entry
> 
> if Client.Platform in HLS\_COMPAT:
> 
> oc.add(LiveStream(hls\_provider=Prefs['hls\_provider']))
> 
> &nbsp;
> 
> return oc
> 
> &nbsp;
> 
> ####################################################################################################
> 
> def LiveStream(hls\_provider='Ustream', include\_container=False):
> 
> &nbsp;
> 
> 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]))
> 
> ]
> 
> )
> 
> ]
> 
> )
> 
> &nbsp;
> 
> if include\_container:
> 
> return ObjectContainer(objects=[vco])
> 
> else:
> 
> return vco
> 
> &nbsp;

&nbsp;

&nbsp;

Any suggestions on what to delete?

&nbsp;

Thanks in advanced for any help!

---

<div class="post-metadata">

**Author:** ![czukowski](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/czukowski/32/9008_2.png) [@czukowski](https://forums.plex.tv/u/czukowski)\
**Post date:** [January 15, 2015, 8:55pm UTC](https://forums.plex.tv/t/channel-straight-to-video/88593/2 "2015-01-15T20:55:05Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![shopgirl284](https://avatars.discourse-cdn.com/v4/letter/s/f6c823/32.png) [@shopgirl284](https://forums.plex.tv/u/shopgirl284)\
**Post date:** [January 16, 2015, 6:29pm UTC](https://forums.plex.tv/t/channel-straight-to-video/88593/3 "2015-01-16T18:29:39Z")

</div>

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&nbsp;[https://forums.plex.tv/topic/131938-having-problem-with-playing-video/?p=793470](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](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](https://github.com/sander1/BijlageTV.bundle/blob/802120912b1c45cf5cc39a7dfdcf5eee26403be7/Contents/Code/ __init__.py)

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/plex/original/3X/2/a/2acb9765406f63293d357b4ec509ec39aa28f2ad.png) [@system](https://forums.plex.tv/u/system)\
**Post date:** [December 21, 2019, 4:03am UTC](https://forums.plex.tv/t/channel-straight-to-video/88593/4 "2019-12-21T04:03:50Z")

</div>

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