I have been working on a MediaPortal channel over the past few weeks and in general it works really well on most clients except Android and Plex/Web.
The Plex/Web client will just spin indefinitely while trying to load the video. A quick glance with Fiddler shows me that the request for the data will load for quite some time before throwing a 404 error. When I look at the logs its repeatedly calling my PlayStream function until it timeouts.
The Android client will actually play video for about 3-5 seconds before it closes the video and goes back to the previous screen. There are no errors in the logs for either client.
Here is the relevant code from my URL Service:
def MediaObjectsForURL(url): return [ MediaObject( parts = [PartObject(key=HTTPLiveStreamURL(Callback(PlayStream, url=url, profile="HTTP Live Streaming medium")))], height = 480, width = 600, bitrate = 640, protocol = "hls", container = "mp4", video_codec = "h264", audio_codec = "aac", audio_channels = 6 ) ]
def PlayStream(url, profile):mp = MediaPortal(url, profile) playlist_url = None active = False try: sessions = mp.request_url(mp.streaming_sessions) session_length = len(sessions) for s in sessions: if mp.id == str(s["Identifier"]): active = True if active == True: playlist_url = mp.custom_transcoder_data % (mp.id) else: if session_length > 0: close = mp.close_streams() init = mp.request_url(mp.init_stream, values = {"identifier": mp.id, "itemId": mp.id, "type": "12"}) start = mp.request_url(mp.start_stream, values = {"identifier": mp.id, "profileName": mp.profile}) playlist_url = start["Result"] return Redirect(playlist_url) except Exception, e: Log(e) raise Ex.MediaNotAvailable
I can attach the MediaPortal class but essentially it has a bunch of hard coded URLS and JSON.ObjectFromURL calls. Here is what the playlist_url URL returns: