platypush/backend/http/app/routes/plugins/media/stream.py
def stream_or_delete_media(media_id):
    """
    This route can be used to stream active media points or unregister
    a mounted media stream
    """

    # Remove the extension
    media_id = '.'.join(media_id.split('.')[:-1])

    try:
        if request.method == 'GET':
            if media_id is None:
                return jsonify([dict(media) for media in media_map.values()])
            else:
                return stream_media(media_id, request)
        else:
            media_info = unregister_media(media_id)
            return jsonify(media_info)
    except (AttributeError, FileNotFoundError) as e:
        abort(404, str(e))
    except KeyError as e:
        abort(400, str(e))
    except Exception as e:
        logger().exception(e)
        abort(500, str(e))

    This route can be used to stream active media points or unregister
    a mounted media stream
    
This route can be used to stream active media points or unregister
a mounted media stream
This route can be used to stream active media points or unregister a mounted media stream
def stream_or_delete_media(media_id):
    media_id = '.'.join(media_id.split('.')[:-1])
    try:
        if request.method == 'GET':
            if media_id is None:
                return jsonify([dict(media) for media in media_map.values()])
            else:
                return stream_media(media_id, request)
        else:
            media_info = unregister_media(media_id)
            return jsonify(media_info)
    except (AttributeError, FileNotFoundError) as e:
        abort(404, str(e))
    except KeyError as e:
        abort(400, str(e))
    except Exception as e:
        logger().exception(e)
        abort(500, str(e))
def stream_or_delete_media ( media_id ) : media_id = '.' . join ( media_id . split ( '.' ) [ : - 1 ] ) try : if request . method == 'GET' : if media_id is None : return jsonify ( [ dict ( media ) for media in media_map . values ( ) ] ) else : return stream_media ( media_id , request ) else : media_info = unregister_media ( media_id ) return jsonify ( media_info ) except ( AttributeError , FileNotFoundError ) as e : abort ( 404 , str ( e ) ) except KeyError as e : abort ( 400 , str ( e ) ) except Exception as e : logger ( ) . exception ( e ) abort ( 500 , str ( e ) )
This route can be used to stream active media points or unregister
a mounted media stream
This route can be used to stream active media points or unregister a mounted media stream
"""
    This route can be used to stream active media points or unregister
    a mounted media stream
    """ # Remove the extension
media_id