$(document).on("click", "[data-behavior=play_recording]", function() {
  if ($(this).hasClass('active')){
    return false;
  }

  var playback_url = $(this).attr("data-playback-url")
  $("#broadcast_video").empty();

  new Clappr.Player({
    parentId: '#broadcast_video',
    source: playback_url,
    width: '100%',
    height: '100%',
    autoPlay: true
  });

  $(".dropdown-menu").children().removeClass('active');
  $(".dropdown-menu").children().children('i').remove();
  $(this).siblings().removeClass('active');
  $(this).siblings().children("i").remove();
  $(this).addClass('active');
  $(this).prepend('<i class="fa fa-check">&nbsp;</i>');
});

