ari-py icon indicating copy to clipboard operation
ari-py copied to clipboard

stop a playback by id !?

Open rezatbaher opened this issue 9 years ago • 1 comments

hi thanks for your efforts i would like to stop a playback by id multiple channels in a single stasis app have playbacks which is generated by id . but on an event i want to stop a specific playback. how can i achieve that ? thanks

rezatbaher avatar Mar 08 '16 06:03 rezatbaher

Works for me

def stop_playback_by_id(playback_id):
    try:
        playback = ari_client.playbacks.get(playbackId=playback_id)
    except requests.exceptions.HTTPError:
        logging.info(u"PlaybackID {} not found".format(playback_id))
        return False
    playback.stop()
    return True

AlekseyLobanov avatar Nov 02 '19 12:11 AlekseyLobanov