Пример #1
0
def PlayVideo(id, bitrate, format, **params):
    response = video_service.get_url(media_id=id,
                                     format=format,
                                     bitrate=bitrate,
                                     other_server=common.other_server())

    url = response['url']

    if not url:
        common.no_contents()
    else:
        return IndirectResponse(MovieObject, key=HTTPLiveStreamURL(url))
Пример #2
0
def PlayHLS(channel_id, bitrate, format, offset, **params):
    response = video_service.get_url(None,
                                     channel_id=channel_id,
                                     bitrate=bitrate,
                                     format=format,
                                     live=True,
                                     offset=offset,
                                     other_server=common.other_server())

    Log(response['url'])

    if not response['url']:
        #common.no_contents()
        raise Ex.MediaNotAvailable
    else:
        return IndirectResponse(VideoClipObject,
                                key=HTTPLiveStreamURL(response['url']))
Пример #3
0
def PlayHLS(channel_id, bitrate, format, offset, **params):
    response = video_service.get_url(
        None,
        channel_id=channel_id,
        bitrate=bitrate,
        format=format,
        live=True,
        offset=offset,
        other_server=common.other_server(),
    )

    Log(response["url"])

    if not response["url"]:
        # common.no_contents()
        raise Ex.MediaNotAvailable
    else:
        return IndirectResponse(VideoClipObject, key=HTTPLiveStreamURL(response["url"]))
Пример #4
0
def PlayVideo(id, bitrate, format, **params):
    response = video_service.get_url(media_id=id, format=format, bitrate=bitrate, other_server=common.other_server())

    url = response['url']

    if not url:
        common.no_contents()
    else:
        return IndirectResponse(MovieObject, key=HTTPLiveStreamURL(url))