Class: Bigbluebutton::RecordingsController

Inherits:
ApplicationController
  • Object
show all
Includes:
BigbluebuttonRails::InternalControllerMethods
Defined in:
app/controllers/bigbluebutton/recordings_controller.rb

Instance Method Summary collapse

Methods included from BigbluebuttonRails::InternalControllerMethods

included

Instance Method Details

#destroyObject



46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# File 'app/controllers/bigbluebutton/recordings_controller.rb', line 46

def destroy
  error = false
  begin
    @recording.destroy
    message = t('bigbluebutton_rails.recordings.notice.destroy.success')
  rescue BigBlueButton::BigBlueButtonException => e
    error = true
    message = t('bigbluebutton_rails.recordings.notice.destroy.success_with_bbb_error', :error => e.to_s[0..200])
  end

  respond_with do |format|
    format.html {
      if error
        flash[:error] = message
        redirect_to_using_params bigbluebutton_recordings_url
      else
        redirect_to_using_params bigbluebutton_recordings_url, :notice => message
      end
    }
  end
end

#determine_layoutObject



11
12
13
14
15
16
17
18
# File 'app/controllers/bigbluebutton/recordings_controller.rb', line 11

def determine_layout
  case params[:action].to_sym
  when :play
    false
  else
    'application'
  end
end

#editObject



29
30
31
# File 'app/controllers/bigbluebutton/recordings_controller.rb', line 29

def edit
  respond_with(@recording)
end

#indexObject



20
21
22
23
# File 'app/controllers/bigbluebutton/recordings_controller.rb', line 20

def index
  @recordings ||= BigbluebuttonRecording.all
  respond_with(@recordings)
end

#playObject



68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
# File 'app/controllers/bigbluebutton/recordings_controller.rb', line 68

def play
  if @recording.present?
    if @playback
      if BigbluebuttonRails.configuration.playback_url_authentication
        uri = @recording.token_url(bigbluebutton_user, request.remote_ip, @playback)
        @playback_url = uri
      else
        @playback_url = @playback.url
      end
      if @playback.downloadable? || !BigbluebuttonRails.configuration.playback_iframe
        redirect_to @playback_url
      end
      # else will render the default 'play' view
    else
      flash[:error] = t('bigbluebutton_rails.recordings.errors.play.no_format')
      redirect_to_using_params bigbluebutton_recording_url(@recording)
    end
  else
    flash[:error] = t('bigbluebutton_rails.recordings.errors.destroyed')
    redirect_to my_home_path
  end
end

#publishObject



91
92
93
# File 'app/controllers/bigbluebutton/recordings_controller.rb', line 91

def publish
  self.publish_unpublish(true)
end

#showObject



25
26
27
# File 'app/controllers/bigbluebutton/recordings_controller.rb', line 25

def show
  respond_with(@recording)
end

#unpublishObject



95
96
97
# File 'app/controllers/bigbluebutton/recordings_controller.rb', line 95

def unpublish
  self.publish_unpublish(false)
end

#updateObject



33
34
35
36
37
38
39
40
41
42
43
44
# File 'app/controllers/bigbluebutton/recordings_controller.rb', line 33

def update
  respond_with @recording do |format|
    if @recording.update_attributes(recording_params)
      format.html {
        message = t('bigbluebutton_rails.recordings.notice.update.success')
        redirect_to_using_params @recording, :notice => message
      }
    else
      format.html { redirect_to_params_or_render :edit }
    end
  end
end