class Admin::BroadcastsController < Admin::ApplicationController
  before_action :set_broadcast, only: [:edit, :update]

  def edit
  end

  def update
    if @broadcast.update(broadcast_update_params)
      redirect_to [:admin, @broadcast.project.account], notice: t(".notice")
    else
      render :edit
    end
  end

  private

  def set_broadcast
    @broadcast = authorize policy_scope(Broadcast).find(params[:id])
  end

  def broadcast_update_params
    params.require(:broadcast).permit(
      :video_conference_url_override,
      :stream_url_override, 
      :stream_key_override, 
      :director_mode_video_embed
    )
  end
end
