opentok 4.7.1 → 4.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 79b0b3d6e3be3dd4a73ec63d8f2be58973c2db372bd1fe56257c6a990b66b544
4
- data.tar.gz: 7a468b0466b4aa3dce26a543667e1491add67df02fe0a78de4fb437ebd0d5b0b
3
+ metadata.gz: c5299537135033f2ae95169f0a47017542fc51ac3bcf24e469219d3f00db5cda
4
+ data.tar.gz: 655c9293034b05b48f39f5f15809d0550f4774c5a097fb49bcf2aa46611e2c44
5
5
  SHA512:
6
- metadata.gz: 5e5ecc34657bb50eaf4da9951a205b12c23fd4379c6c3e2fc484fab2f2911c622ff85221412dd2aa774605bdda737966d561d6ada4b49816fbb21e687abfb22b
7
- data.tar.gz: 5888fdc7ab677937f3e17e7c5cb293fdccaff970f75099a7900ef4b75bc12916bd843460247f2426e2345122537b23f8bb5c3955e567f1ad94d0f4dc3a757f8c
6
+ metadata.gz: 8b83473744134b0754c092d2a98e6d28af5a80c6ee373c48c8569af75cf84fc0106321c6a7b8e72ec253379bc4a4e431069a3c62fdcf45f7fba172ebf61e700f
7
+ data.tar.gz: b6946da6f229d0030fde0a09a9e969c7906f7da54151ed1f749b6af9bcd0ea0e1787521a73a98c23cebbaa60df4b8e79bddd39acd2d8367b721909488f65bc26
data/CHANGES.md CHANGED
@@ -1,3 +1,11 @@
1
+ # 4.8.1
2
+
3
+ * Fixes a bug with the `Archives#create` method. See [#269](https://github.com/opentok/OpenTok-Ruby-SDK/pull/269) and [#270](https://github.com/opentok/OpenTok-Ruby-SDK/pull/270)
4
+
5
+ # 4.8.0
6
+
7
+ * Add support for Captions API [#267](https://github.com/opentok/OpenTok-Ruby-SDK/pull/267)
8
+
1
9
  # 4.7.1
2
10
 
3
11
  * Updates docs comments for `Broadcasts` and `Sip` [#266](https://github.com/opentok/OpenTok-Ruby-SDK/pull/266)
@@ -72,13 +72,14 @@ module OpenTok
72
72
  # set to null. The download URL is obfuscated, and the file is only available from the URL for
73
73
  # 10 minutes. To generate a new URL, call the Archive.listArchives() or OpenTok.getArchive() method.
74
74
  class Archive
75
- attr_reader :multi_archive_tag
75
+ attr_reader :multi_archive_tag, :stream_mode
76
76
  # @private
77
77
  def initialize(interface, json)
78
78
  @interface = interface
79
79
  # TODO: validate json fits schema
80
80
  @json = json
81
81
  @multi_archive_tag = @json['multiArchiveTag']
82
+ @stream_mode = @json['streamMode']
82
83
  end
83
84
 
84
85
  # A JSON-encoded string representation of the archive.
@@ -39,11 +39,11 @@ module OpenTok
39
39
  # (a video track is included). If you set both <code>has_audio</code> and
40
40
  # <code>has_video</code> to <code>false</code>, the call to the <code>create()</code>
41
41
  # method results in an error.
42
- # @option options [String] :multiArchiveTag (Optional) Set this to support recording multiple archives for the same session simultaneously.
42
+ # @option options [String] :multi_archive_tag (Optional) Set this to support recording multiple archives for the same session simultaneously.
43
43
  # Set this to a unique string for each simultaneous archive of an ongoing session. You must also set this option when manually starting an archive
44
44
  # that is {https://tokbox.com/developer/guides/archiving/#automatic automatically archived}. Note that the `multiArchiveTag` value is not included
45
45
  # in the response for the methods to {https://tokbox.com/developer/rest/#listing_archives list archives} and
46
- # {https://tokbox.com/developer/rest/#retrieve_archive_info retrieve archive information}. If you do not specify a unique `multiArchiveTag`,
46
+ # {https://tokbox.com/developer/rest/#retrieve_archive_info retrieve archive information}. If you do not specify a unique `multi_archive_tag`,
47
47
  # you can only record one archive at a time for a given session.
48
48
  # {https://tokbox.com/developer/guides/archiving/#simultaneous-archives See Simultaneous archives}.
49
49
  # @option options [String] :output_mode Whether all streams in the archive are recorded
@@ -56,7 +56,7 @@ module OpenTok
56
56
  # (HD portrait), or "1080x1920" (FHD portrait). This property only applies to composed archives. If you set
57
57
  # this property and set the outputMode property to "individual", a call to the method
58
58
  # results in an error.
59
- # @option options [String] :streamMode (Optional) Whether streams included in the archive are selected
59
+ # @option options [String] :stream_mode (Optional) Whether streams included in the archive are selected
60
60
  # automatically ("auto", the default) or manually ("manual"). When streams are selected automatically ("auto"),
61
61
  # all streams in the session can be included in the archive. When streams are selected manually ("manual"),
62
62
  # you specify streams to be included based on calls to the {Archives#add_stream} method. You can specify whether a
@@ -97,7 +97,16 @@ module OpenTok
97
97
  "Resolution cannot be supplied for individual output mode" if options.key?(:resolution) and options[:output_mode] == :individual
98
98
 
99
99
  # normalize opts so all keys are symbols and only include valid_opts
100
- valid_opts = [ :name, :has_audio, :has_video, :output_mode, :resolution, :layout ]
100
+ valid_opts = [
101
+ :name,
102
+ :has_audio,
103
+ :has_video,
104
+ :output_mode,
105
+ :resolution,
106
+ :layout,
107
+ :multi_archive_tag,
108
+ :stream_mode
109
+ ]
101
110
  opts = options.inject({}) do |m,(k,v)|
102
111
  if valid_opts.include? k.to_sym
103
112
  m[k.to_sym] = v
@@ -0,0 +1,61 @@
1
+ module OpenTok
2
+ # A class for working with OpenTok captions.
3
+ class Captions
4
+ # @private
5
+ def initialize(client)
6
+ @client = client
7
+ end
8
+
9
+ # Starts live captions for the specified OpenTok session.
10
+ # See the {https://tokbox.com/developer/guides/live-captions/ OpenTok Live Captions developer guide}.
11
+ #
12
+ # @example
13
+ # opts = { "language_code" => "en-GB",
14
+ # "max_duration" => 5000,
15
+ # "partial_captions" => false,
16
+ # "status_callback_url" => status_callback_url
17
+ # }
18
+ # response = opentok.captions.start(session_id, token, opts)
19
+ #
20
+ # @param [String] session_id The session ID corresponding to the session for which captions will start.
21
+ # @param [String] token The token for the session ID with which the SIP user will use to connect.
22
+ # @param [Hash] options A hash defining options for the captions. For example:
23
+ # @option options [String] :language_code The BCP-47 code for a spoken language used on this call.
24
+ # The default value is "en-US". The following language codes are supported:
25
+ # - "en-AU" (English, Australia)
26
+ # - "en-GB" (Englsh, UK)
27
+ # - "es-US" (English, US)
28
+ # - "zh-CN” (Chinese, Simplified)
29
+ # - "fr-FR" (French)
30
+ # - "fr-CA" (French, Canadian)
31
+ # - "de-DE" (German)
32
+ # - "hi-IN" (Hindi, Indian)
33
+ # - "it-IT" (Italian)
34
+ # - "ja-JP" (Japanese)
35
+ # - "ko-KR" (Korean)
36
+ # - "pt-BR" (Portuguese, Brazilian)
37
+ # - "th-TH" (Thai)
38
+ # @option options [Integer] :max_duration The maximum duration for the audio captioning, in seconds.
39
+ # The default value is 14,400 seconds (4 hours), the maximum duration allowed.
40
+ # @option options [Boolean] :partial_captions Whether to enable this to faster captioning at the cost of some
41
+ # degree of inaccuracies. The default value is `true`.
42
+ # @option options [String] :status_callback_url A publicly reachable URL controlled by the customer and capable
43
+ # of generating the content to be rendered without user intervention. The minimum length of the URL is 15
44
+ # characters and the maximum length is 2048 characters.
45
+ # For more information, see {https://tokbox.com/developer/guides/live-captions/#live-caption-status-updates Live Caption status updates}.
46
+ def start(session_id, token, options = {})
47
+ @client.start_live_captions(session_id, token, options)
48
+ end
49
+
50
+ # Starts live captions for the specified OpenTok session.
51
+ # See the {https://tokbox.com/developer/guides/live-captions/ OpenTok Live Captions developer guide}.
52
+ #
53
+ # @example
54
+ # response = opentok.captions.stop(captions_id)
55
+ #
56
+ # @param [String] captions_id The ID for the captions to be stopped (returned from the `start` request).
57
+ def stop(captions_id)
58
+ @client.stop_live_captions(captions_id)
59
+ end
60
+ end
61
+ end