Class: OpenVidu::Recording

Inherits:
Base
  • Object
show all
Defined in:
lib/open_vidu/recording.rb

Overview

Recording

Constant Summary collapse

ASSIGNABLE_PARAMS =
%w[
  session name outputMode hasAudio hasVideo recordingLayout customLayout
  resolution
].freeze
GENERATED_PARAMS =
%w[
  id sessionId createdAt size duration url status
].freeze
ALL_PARAMS =
(ASSIGNABLE_PARAMS + GENERATED_PARAMS).freeze

Instance Attribute Summary

Attributes inherited from Base

#server

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#create_params, #initialize

Constructor Details

This class inherits a constructor from OpenVidu::Base

Class Method Details

.content_keyObject



13
14
15
# File 'lib/open_vidu/recording.rb', line 13

def self.content_key
  'items'
end

Instance Method Details

#allObject



17
18
19
20
21
22
23
24
# File 'lib/open_vidu/recording.rb', line 17

def all
  OpenVidu::Command.new(
    :recording,
    :get,
    'api/recordings',
    { options: { server: server } }
  ).execute
end

#createObject Also known as: start



51
52
53
54
55
56
57
58
59
# File 'lib/open_vidu/recording.rb', line 51

def create
  OpenVidu::Command.new(
    :recording,
    :post,
    'api/recordings/start',
    create_params,
    { options: { server: server } }
  ).execute
end

#deleteObject



42
43
44
45
46
47
48
49
# File 'lib/open_vidu/recording.rb', line 42

def delete
  OpenVidu::Command.new(
    :recording,
    :delete,
    "api/recordings/#{id}",
    { options: { server: server } }
  ).execute
end

#find(id) ⇒ Object



26
27
28
29
30
31
# File 'lib/open_vidu/recording.rb', line 26

def find(id)
  OpenVidu::Command.new(
    :recording, :get, "api/recordings/#{id}",
    { options: { server: server } }
  ).execute
end

#stopObject



33
34
35
36
37
38
39
40
# File 'lib/open_vidu/recording.rb', line 33

def stop
  OpenVidu::Command.new(
    :recording,
    :post,
    "api/recordings/stop/#{id}",
    { options: { server: server } }
  ).execute
end