Class: AdobeConnectConference

Inherits:
WebConference
  • Object
show all
Defined in:
app/models/adobe_connect_conference.rb

Overview

Copyright © 2012 Instructure, Inc.

This file is part of Canvas.

Canvas is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, version 3 of the License.

Canvas is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License along with this program. If not, see <www.gnu.org/licenses/>.

Constant Summary collapse

MAX_USERNAME_LENGTH =
60

Instance Method Summary collapse

Instance Method Details

#admin_join_url(admin, _ = nil) ⇒ Object

Public: Add an admin to the conference and create a meeting URL (required by WebConference).

admin - The user to add to the conference as an admin. _ - Included for compatibility w/ web_conference.rb

Returns a meeting URL string.



52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# File 'app/models/adobe_connect_conference.rb', line 52

def admin_join_url(admin, _ = nil)
  user = add_host(admin)

  if config[:use_sis_ids] == "no" 
    settings = { :username => user.username, :password => user.password,
      :domain => CanvasConnect.config[:domain] }

    service = AdobeConnect::Service.new(settings)
    service.

    "#{meeting_url}?session=#{service.session}"
  else
    meeting_url
  end 
end

#conference_statusObject

Public: Determine the status of the conference (required by WebConference).

Returns conference status as a symbol (either :active or :closed).



38
39
40
41
42
43
44
# File 'app/models/adobe_connect_conference.rb', line 38

def conference_status
  if meeting_exists?
    :active
  else
    :closed
  end
end

#initiate_conferenceObject

Public: Start a new conference and return its key. (required by WebConference)

Returns a conference key string.



26
27
28
29
30
31
32
33
# File 'app/models/adobe_connect_conference.rb', line 26

def initiate_conference
  unless conference_key.present?
    create_meeting unless meeting_exists?
    save
  end

  find_conference_key
end

#participant_join_url(user, _ = nil) ⇒ Object

Public: Add a participant to the conference and create a meeting URL.

Make the user a conference admin if they have permissions to create
a conference (required by WebConference).

user - The user to add to the conference as an admin. _ - Included for compatibility w/ web_conference.rb

Returns a meeting URL string.



76
77
78
79
80
81
82
83
84
# File 'app/models/adobe_connect_conference.rb', line 76

def participant_join_url(user, _ = nil)
  if grants_right?(user, nil, :initiate)
    admin_join_url(user)
  elsif config[:use_sis_ids] == "no" 
    "#{meeting_url}?guestName=#{URI.escape(user.name)}"
  else 
    meeting_url
  end
end

#recordingsObject

Public: List all of the recordings for a meeting

Returns an Array of MeetingArchive, or an empty Array if there are no recordings



89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
# File 'app/models/adobe_connect_conference.rb', line 89

def recordings
  if key = find_conference_key
      CanvasConnect::MeetingArchive.retrieve(key).map do |recording|
      {
        recording_id: recording.id,
        duration_minutes: recording.duration.to_i,
        title: recording.name,
        updated_at: recording.date_modified,
        created_at: recording.date_created,
        playback_url: "#{config[:domain]}#{recording.url_path}",
      }
    end
  else
    []
  end
end