Exemplo n.º 1
0
    def play(self, sid):
        stream = IStream.get_by_id(ObjectId(sid))
        if stream:
            return Response(stream.generate_playlist(),
                            mimetype='application/x-mpequrl'), 200

        return jsonify(status='failed'), 404
Exemplo n.º 2
0
 def remove_own_stream_by_id(self, sid: ObjectId):
     stream = IStream.get_by_id(sid)
     if stream:
         for stream in self.streams:
             if stream.sid == sid:
                 self.stream.remove(stream)
         stream.delete()
Exemplo n.º 3
0
 def remove_own_vod_by_id(self, sid: ObjectId):
     vod = IStream.get_by_id(sid)
     if vod:
         for vod in self.vod:
             if vod.private and vod.sid == sid:
                 self.vod.remove(vod)
         vod.delete()
Exemplo n.º 4
0
 def add_stream_by_id(self, sid: ObjectId) -> IStreamObject:
     stream = IStream.get_by_id(sid)
     return self.add_stream(stream)
Exemplo n.º 5
0
 def remove_official_catchup_by_id(self, sid: ObjectId):
     original_stream = IStream.get_by_id(sid)
     self.remove_official_catchup(original_stream)