HLS audio streaming

Hey guys, I'm kinda lost in this plugin development. The online docs are insufficient and I've been looking at the framework it self for reference, but I'm having one issue in particular thats bugging me. 

def SpilaRas1():
	mc = ObjectContainer()
	url = "http://sip-live.hds.adaptive.level3.net/hls-live/ruv-ras1/_definst_/live/stream1.m3u8"
track = TrackObject(
	url = url,
	key = HLSURL(url),
	title = "RAS 1",
	artist = "RUV",
	summary = "BEIN UTSENDIND",
	album = 'Hvad stendur her?',
	duration = 999,
	rating_key = 0,
#	thumb = image,
#	art = image
)
media = MediaObject(

	protocols		= Protocol.HLS,
	bitrate			= 44100,
	parts 			= [PartObject(key=Callback(PlayLiveAudio, url=url, ext='ts'))],
	container		= Container.MP4,
	audio_codec 	= AudioCodec.AAC,
	audio_channels	= 2
)
track.add(media)
mc.add(track)

return mc

def PlayLiveAudio(url):
return Redirect(url)

The damn thing won't play, neither in PHT nor the Web interface. 

 

Am I overseeing something?

I'm not 100% sure how HLS audio-only streams are handled but, assuming they work as expected, you're using the key & rating_key properties incorrectly.

Take a look at the code for the PlexPodcast channel for an example of how to pass audio files without using an URL Service.

I've taken a good look at what you mentioned, and I've added this recursive Callback. But now there seems to be a different problem with a route. I'm not quite familiar with routes. 

https://gist.github.com/anonymous/9745041

2014-03-24 17:29:19,703 (7f398d7fa700) :  ERROR (runtime:846) - Could not find route matching /music/netutvarp/createHLSRadioStreamObject/http://sip-live.hds.adaptive.level3.net/hls-live/ruv-ras1/_definst_/live/stream1.m3u8
2014-03-24 17:29:19,704 (7f398d7fa700) :  DEBUG (runtime:106) - Sending packed state data (110 bytes)
2014-03-24 17:29:19,705 (7f398d7fa700) :  DEBUG (runtime:918) - Response: [404] NoneType, 0 bytes
2014-03-24 17:29:20,854 (7f398d7fa700) :  DEBUG (runtime:717) - Handling request GET /music/netutvarp/createHLSRadioStreamObject/http%3A//sip-live.hds.adaptive.level3.net/hls-live/ruv-ras2/_definst_/live/stream1.m3u8?container=True&title=RAS%2B2
2014-03-24 17:29:20,858 (7f398d7fa700) :  CRITICAL (runtime:493) - Exception matching route for path "/music/netutvarp/createHLSRadioStreamObject/http://sip-live.hds.adaptive.level3.net/hls-live/ruv-ras2/_definst_/live/stream1.m3u8" (most recent call last):
  File "/var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Plug-ins/Framework.bundle/Contents/Resources/Versions/2/Python/Framework/components/runtime.py", line 464, in match_route
    raise Framework.exceptions.FrameworkException("No route found matching '%s'" % path)
FrameworkException: No route found matching '/music/netutvarp/createHLSRadioStreamObject/http://sip-live.hds.adaptive.level3.net/hls-live/ruv-ras2/_definst_/live/stream1.m3u8'

How do routes work?

The routes are used to provide a more RESTful interface for the channel methods.

In your case, I don't think that's its really necessary. You'll notice that there are no routes used in the PlexPodcast channel.

It would be a good idea to add the @handler decorator to your MainMenu(). That will allow you to remove the PrefixHandler lines

Plugin.AddPrefixHandler(
		PREFIX,
		MainMenu,
		TITLE,
		ART,
		ICON
	)

I would also suggest removing the ViewGroup definitions, since most (if not all clients) ignore viewgroups that channels provide anyways.

Plugin.AddViewGroup('stationList',
		viewMode 		= 'WallStream',
		mediaType 		= 'items'
	)

I've done some improvements.

This is a log for one request to play a stream https://gist.github.com/anonymous/9752019

and this is my current plugin: https://gist.github.com/anonymous/9752043

But to no avail, nothing plays. 

I made some changes and comments.

https://gist.github.com/mikedm139/4ca6eac9248712214442

Thanks for taking your time to help me with this. Are there any rumors speculating updates on the API and docs?

As I understand it, updates to the API and docs are planned but (as with all things Plex), there are no public timelines.

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