├── .github └── workflows │ ├── ci.yml │ └── metrics.yml ├── .gitignore ├── .yardopts ├── CHANGES.md ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── DEVELOPING.md ├── Gemfile ├── LICENSE ├── README.md ├── Rakefile ├── lib ├── opentok.rb └── opentok │ ├── archive.rb │ ├── archive_list.rb │ ├── archives.rb │ ├── broadcast.rb │ ├── broadcast_list.rb │ ├── broadcasts.rb │ ├── captions.rb │ ├── client.rb │ ├── connections.rb │ ├── constants.rb │ ├── exceptions.rb │ ├── extensions │ └── hash.rb │ ├── opentok.rb │ ├── render.rb │ ├── render_list.rb │ ├── renders.rb │ ├── session.rb │ ├── signals.rb │ ├── sip.rb │ ├── stream.rb │ ├── stream_list.rb │ ├── streams.rb │ ├── token_generator.rb │ ├── version.rb │ └── websocket.rb ├── opentok.gemspec ├── sample ├── Archiving │ ├── Gemfile │ ├── README.md │ ├── archiving_sample.rb │ ├── public │ │ ├── css │ │ │ └── sample.css │ │ ├── img │ │ │ ├── archiving-off.png │ │ │ ├── archiving-on-idle.png │ │ │ └── archiving-on-message.png │ │ └── js │ │ │ ├── host.js │ │ │ └── participant.js │ └── views │ │ ├── history.erb │ │ ├── host.erb │ │ ├── index.erb │ │ ├── layout.erb │ │ └── participant.erb ├── Broadcast │ ├── Gemfile │ ├── README.md │ ├── broadcast_sample.rb │ ├── public │ │ ├── css │ │ │ └── sample.css │ │ └── js │ │ │ ├── host.js │ │ │ └── participant.js │ └── views │ │ ├── all.erb │ │ ├── host.erb │ │ ├── index.erb │ │ ├── layout.erb │ │ └── participant.erb └── HelloWorld │ ├── Gemfile │ ├── README.md │ ├── hello_world.rb │ ├── public │ └── js │ │ └── helloworld.js │ └── views │ └── index.erb └── spec ├── cassettes ├── OpenTok_Archives │ ├── adds_a_stream_to_an_archive.yml │ ├── calls_layout_on_archive_object.yml │ ├── changes_the_layout_of_an_archive.yml │ ├── http_client_errors │ │ └── .yml │ ├── removes_a_stream_from_an_archive.yml │ ├── should_create_an_archive_with_matching_multi_archive_tag_when_multiArchiveTag_is_specified.yml │ ├── should_create_an_archive_with_maxBitrate_set_to_specified_max_bitrate_value.yml │ ├── should_create_an_archive_with_multi_archive_tag_value_of_nil_when_multiArchiveTag_not_specified.yml │ ├── should_create_an_archive_with_streamMode_set_to_specified_stream_mode_value.yml │ ├── should_create_an_archives_with_a_specified_multiArchiveTag.yml │ ├── should_create_archives.yml │ ├── should_create_audio_only_archives.yml │ ├── should_create_custom_layout_archives.yml │ ├── should_create_hd_archives.yml │ ├── should_create_individual_archives.yml │ ├── should_create_layout_archives_with_screenshare_layout_types.yml │ ├── should_create_named_archives.yml │ ├── should_delete_an_archive_by_id.yml │ ├── should_find_archives_by_id.yml │ ├── should_find_archives_with_unknown_properties.yml │ ├── should_find_expired_archives.yml │ ├── should_find_paused_archives_by_id.yml │ ├── should_stop_archives.yml │ └── when_many_archives_are_created │ │ ├── should_return_all_archives.yml │ │ ├── should_return_archives_with_an_offset.yml │ │ ├── should_return_count_number_of_archives.yml │ │ ├── should_return_part_of_the_archives_when_using_offset_and_count.yml │ │ └── should_return_session_archives.yml ├── OpenTok_Broadcasts │ ├── adds_a_stream_to_a_broadcast.yml │ ├── calls_layout_on_broadcast_object.yml │ ├── changes_the_layout_of_a_broadcast.yml │ ├── fetches_a_hls_broadcast_url.yml │ ├── finds_a_broadcast.yml │ ├── for_many_broadcasts │ │ ├── should_return_all_broadcasts.yml │ │ ├── should_return_broadcasts_with_an_offset.yml │ │ ├── should_return_count_number_of_broadcasts.yml │ │ ├── should_return_part_of_the_broadcasts_when_using_offset_and_count.yml │ │ └── should_return_session_broadcasts.yml │ ├── removes_a_stream_from_a_broadcast.yml │ ├── starts_a_broadcast_with_a_matching_multi_broadcast_tag_value_when_multiBroadcastTag_is_specified.yml │ ├── starts_a_broadcast_with_a_multi_broadcast_tag_value_of_nil_when_multiBroadcastTag_not_specified.yml │ ├── starts_a_broadcast_with_a_specified_multiBroadcastTag.yml │ ├── starts_a_rtmp_broadcast.yml │ └── stops_a_broadcast.yml ├── OpenTok_Captions │ ├── receives_a_valid_response_when_starting_captions.yml │ ├── receives_a_valid_response_when_starting_captions_with_options.yml │ └── receives_a_valid_response_when_stopping_captions.yml ├── OpenTok_Connections │ └── forces_a_connection_to_be_terminated.yml ├── OpenTok_OpenTok │ └── when_initialized_properly │ │ ├── _create_session │ │ ├── creates_always_archived_sessions.yml │ │ ├── creates_always_archived_sessions_with_a_set_archive_name.yml │ │ ├── creates_always_archived_sessions_with_a_set_archive_name_and_resolution.yml │ │ ├── creates_always_archived_sessions_with_a_set_archive_resolution.yml │ │ ├── creates_default_sessions.yml │ │ ├── creates_e2ee_sessions.yml │ │ ├── creates_relayed_media_sessions.yml │ │ ├── creates_relayed_media_sessions_for_invalid_media_modes.yml │ │ ├── creates_relayed_media_sessions_with_a_location_hint.yml │ │ ├── creates_routed_media_sessions.yml │ │ ├── creates_routed_media_sessions_with_a_location_hint.yml │ │ └── creates_sessions_with_a_location_hint.yml │ │ └── with_an_addendum_to_the_user_agent_string │ │ └── should_append_the_addendum_to_the_user_agent_header.yml ├── OpenTok_Renders │ ├── finds_an_Experience_Composer_render.yml │ ├── for_many_renders │ │ ├── should_return_all_renders.yml │ │ ├── should_return_count_number_of_renders.yml │ │ ├── should_return_part_of_the_renders_when_using_offset_and_count.yml │ │ └── should_return_renders_with_an_offset.yml │ ├── starts_an_Experience_Composer_render.yml │ └── stops_an_Experience_Composer_render.yml ├── OpenTok_Signals │ ├── receives_a_valid_response_for_a_connection.yml │ └── receives_a_valid_response_for_all_connections.yml ├── OpenTok_Sip │ ├── _play_dtmf_to_connection │ │ └── returns_a_200_response_code_when_passed_a_valid_dtmf_digit_string.yml │ ├── _play_dtmf_to_session │ │ └── returns_a_200_response_code_when_passed_a_valid_dtmf_digit_string.yml │ └── receives_a_valid_response.yml ├── OpenTok_Streams │ ├── disables_the_mute_state_of_a_session.yml │ ├── forces_all_current_and_future_streams_in_a_session_to_be_muted.yml │ ├── forces_all_current_and_future_streams_in_a_session_to_be_muted_except_specified_excluded_streams.yml │ ├── forces_the_specified_stream_to_be_muted.yml │ ├── get_all_streams_information.yml │ ├── get_specific_stream_information.yml │ └── layout_working_on_two_stream_list.yml └── OpenTok_WebSocket │ └── receives_a_valid_response.yml ├── matchers └── token.rb ├── opentok ├── archives_spec.rb ├── broadcasts_spec.rb ├── captions_spec.rb ├── client_spec.rb ├── connection_spec.rb ├── opentok_spec.rb ├── renders_spec.rb ├── session_spec.rb ├── signal_spec.rb ├── sip_spec.rb ├── streams_spec.rb └── websocket_spec.rb ├── shared ├── opentok_generates_tokens.rb └── session_generates_tokens.rb └── spec_helper.rb /.github/workflows/ci.yml: -------------------------------------------------------------------------------- 1 | name: CI 2 | 3 | on: 4 | push: 5 | branches: [ main, dev, beta ] 6 | pull_request: 7 | branches: [ main, dev, beta ] 8 | 9 | jobs: 10 | test: 11 | strategy: 12 | matrix: 13 | os: [ubuntu-latest, windows-latest, macos-latest] 14 | ruby: [3.0, 3.1, 3.2, 3.3] 15 | exclude: 16 | - os: windows-latest 17 | ruby: 3.0 18 | runs-on: ${{ matrix.os }} 19 | steps: 20 | - uses: actions/checkout@v2 21 | - name: Set up Ruby 22 | uses: ruby/setup-ruby@v1 23 | with: 24 | ruby-version: ${{ matrix.ruby }} 25 | - name: Install dependencies 26 | run: bundle install 27 | - name: Run tests 28 | run: bundle exec rake spec 29 | env: 30 | CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} 31 | -------------------------------------------------------------------------------- /.github/workflows/metrics.yml: -------------------------------------------------------------------------------- 1 | name: Aggregit 2 | 3 | on: 4 | schedule: 5 | - cron: "0 0 * * *" 6 | 7 | jobs: 8 | recordMetrics: 9 | runs-on: ubuntu-latest 10 | steps: 11 | - uses: michaeljolley/aggregit@v1 12 | with: 13 | githubToken: ${{ secrets.GITHUB_TOKEN }} 14 | project_id: ${{ secrets.project_id }} 15 | private_key: ${{ secrets.private_key }} 16 | client_email: ${{ secrets.client_email }} 17 | firebaseDbUrl: ${{ secrets.firebaseDbUrl }} 18 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.gem 2 | *.rbc 3 | .bundle 4 | .config 5 | .yardoc 6 | Gemfile.lock 7 | InstalledFiles 8 | _yardoc 9 | coverage 10 | 11 | lib/bundler/man 12 | pkg 13 | rdoc 14 | spec/reports 15 | test/tmp 16 | test/version_tmp 17 | tmp 18 | vendor 19 | 20 | .DS_Store -------------------------------------------------------------------------------- /.yardopts: -------------------------------------------------------------------------------- 1 | 'lib/**/*.rb' --no-private --readme doc/README.md -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing Guidelines 2 | 3 | For anyone looking to get involved to this project, we are glad to hear from you. Here are a few types of contributions 4 | that we would be interested in hearing about. 5 | 6 | * Bug fixes 7 | - If you find a bug, please first report it using Github Issues. 8 | - Issues that have already been identified as a bug will be labelled `bug`. 9 | - If you'd like to submit a fix for a bug, send a Pull Request from your own fork and mention the Issue number. 10 | + Include a test that isolates the bug and verifies that it was fixed. 11 | * New Features 12 | - If you'd like to accomplish something in the library that it doesn't already do, describe the problem in a new 13 | Github Issue. 14 | - Issues that have been identified as a feature request will be labelled `enhancement`. 15 | - If you'd like to implement the new feature, please wait for feedback from the project maintainers before spending 16 | too much time writing the code. In some cases, `enhancement`s may not align well with the project objectives at 17 | the time. 18 | * Tests, Documentation, Miscellaneous 19 | - If you think the test coverage could be improved, the documentation could be clearer, you've got an alternative 20 | implementation of something that may have more advantages, or any other change we would still be glad hear about 21 | it. 22 | - If its a trivial change, go ahead and send a Pull Request with the changes you have in mind 23 | - If not, open a Github Issue to discuss the idea first. 24 | 25 | ## Requirements 26 | 27 | For a contribution to be accepted: 28 | 29 | * The test suite must be complete and pass 30 | * Code must follow existing styling conventions 31 | * Commit messages must be descriptive. Related issues should be mentioned by number. 32 | 33 | If the contribution doesn't meet these criteria, a maintainer will discuss it with you on the Issue. You can still 34 | continue to add more commits to the branch you have sent the Pull Request from. 35 | 36 | ## How To 37 | 38 | 1. Fork this repository on GitHub. 39 | 1. Clone/fetch your fork to your local development machine. 40 | 1. Create a new branch (e.g. `issue-12`, `feat.add_foo`, etc) and check it out. 41 | 1. Make your changes and commit them. (Did the tests pass?) 42 | 1. Push your new branch to your fork. (e.g. `git push myname issue-12`) 43 | 1. Open a Pull Request from your new branch to the original fork's `master` branch. 44 | 45 | ## Developer Guidelines 46 | 47 | See DEVELOPING.md for guidelines for developing this project. 48 | -------------------------------------------------------------------------------- /Gemfile: -------------------------------------------------------------------------------- 1 | source "http://rubygems.org" 2 | 3 | gem "pry" 4 | 5 | # Specify your gem's dependencies in opentok.gemspec 6 | gemspec 7 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 TokBox, Inc. 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /Rakefile: -------------------------------------------------------------------------------- 1 | require "bundler/gem_tasks" 2 | require "rspec/core/rake_task" 3 | require "yard" 4 | 5 | RSpec::Core::RakeTask.new(:spec) 6 | 7 | YARD::Rake::YardocTask.new do |t| 8 | # t.files = ['lib/**/*.rb', OTHER_PATHS] # optional 9 | # t.options = ['--any', '--extra', '--opts'] # optional 10 | end 11 | 12 | desc "Open an irb session preloaded with this library" 13 | task :console do 14 | sh "irb -rubygems -I lib -r opentok.rb" 15 | end 16 | 17 | task :default => :spec 18 | -------------------------------------------------------------------------------- /lib/opentok.rb: -------------------------------------------------------------------------------- 1 | require "opentok/opentok" 2 | 3 | # Namespace for classes and modules in the OpenTok Ruby SDK. 4 | module OpenTok 5 | 6 | end 7 | -------------------------------------------------------------------------------- /lib/opentok/archive_list.rb: -------------------------------------------------------------------------------- 1 | require "opentok/archive" 2 | 3 | module OpenTok 4 | # A class for accessing an array of Archive objects. 5 | class ArchiveList < Array 6 | 7 | # The total number archives. 8 | attr_reader :total 9 | 10 | # @private 11 | def initialize(interface, json) 12 | @total = json['count'] 13 | super json['items'].map { |item| Archive.new interface, item } 14 | end 15 | 16 | end 17 | end 18 | -------------------------------------------------------------------------------- /lib/opentok/broadcast_list.rb: -------------------------------------------------------------------------------- 1 | require "opentok/broadcast" 2 | 3 | module OpenTok 4 | # A class for accessing an array of Broadcast objects. 5 | class BroadcastList < Array 6 | # The total number of broadcasts. 7 | attr_reader :total 8 | 9 | def initialize(interface, json) 10 | @total = json["count"] 11 | super json["items"].map { |item| ::OpenTok::Broadcast.new interface, item } 12 | end 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /lib/opentok/captions.rb: -------------------------------------------------------------------------------- 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 62 | -------------------------------------------------------------------------------- /lib/opentok/connections.rb: -------------------------------------------------------------------------------- 1 | module OpenTok 2 | # A class for working with OpenTok connections. 3 | class Connections 4 | # @private 5 | def initialize(client) 6 | @client = client 7 | end 8 | 9 | # Force a client to disconnect from an OpenTok session. 10 | # 11 | # A client must be actively connected to the OpenTok session for you to disconnect it. 12 | # 13 | # @param [String] session_id The session ID of the OpenTok session. 14 | # @param [String] connection_id The connection ID of the client in the session. 15 | # 16 | # @raise [ArgumentError] The connection_id or session_id is invalid. 17 | # @raise [OpenTokAuthenticationError] You are not authorized to disconnect the connection. Check your authentication credentials. 18 | # @raise [OpenTokConnectionError] The client specified by the connection_id property is not connected to the session. 19 | # 20 | def forceDisconnect(session_id, connection_id ) 21 | raise ArgumentError, "session_id not provided" if session_id.to_s.empty? 22 | raise ArgumentError, "connection_id not provided" if connection_id.to_s.empty? 23 | response = @client.forceDisconnect(session_id, connection_id) 24 | (200..300).include? response.code 25 | end 26 | 27 | end 28 | end 29 | -------------------------------------------------------------------------------- /lib/opentok/constants.rb: -------------------------------------------------------------------------------- 1 | module OpenTok 2 | require "set" 3 | API_URL = "https://api.opentok.com" 4 | TOKEN_SENTINEL = "T1==" 5 | ROLES = { subscriber: "subscriber", publisher: "publisher", moderator: "moderator", publisheronly: "publisheronly" } 6 | ARCHIVE_MODES = ::Set.new([:manual, :always]) 7 | AUTH_EXPIRE = 300 8 | end 9 | -------------------------------------------------------------------------------- /lib/opentok/exceptions.rb: -------------------------------------------------------------------------------- 1 | module OpenTok 2 | 3 | # Defines errors raised by methods of the OpenTok Ruby SDK. 4 | class OpenTokError < StandardError; end 5 | # Defines errors raised by archive-related methods of the OpenTok Ruby SDK. 6 | class OpenTokArchiveError < OpenTokError; end 7 | # Defines errors raised by SIP methods of the OpenTok Ruby SDK. 8 | class OpenTokSipError < OpenTokError; end 9 | # Defines errors raised when you attempt an operation using an invalid OpenTok API key or secret. 10 | class OpenTokAuthenticationError < OpenTokError; end 11 | # Defines errors raised when you attempt a force disconnect a client and it is not connected to the session. 12 | class OpenTokConnectionError < OpenTokError; end 13 | # Defines errors raised when you attempt set layout classes to a stream. 14 | class OpenTokStreamLayoutError < OpenTokError; end 15 | # Defines errors raised when you perform Broadcast operations. 16 | class OpenTokBroadcastError < OpenTokError; end 17 | # Defines errors raised when connecting to WebSocket URIs. 18 | class OpenTokWebSocketError < OpenTokError; end 19 | # Defines errors raised when you perform Experience Composer render operations. 20 | class OpenTokRenderError < OpenTokError; end 21 | # Defines errors raised when you perform Captions operations. 22 | class OpenTokCaptionsError < OpenTokError; end 23 | end 24 | -------------------------------------------------------------------------------- /lib/opentok/extensions/hash.rb: -------------------------------------------------------------------------------- 1 | module OpenTok 2 | module HashExtensions 3 | def camelize_keys! 4 | keys.each do |k| 5 | new_key = k.to_s.camelize(:lower) 6 | new_key = new_key.to_sym if k.is_a? Symbol 7 | self[new_key] = self.delete(k) 8 | end 9 | self 10 | end 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /lib/opentok/render.rb: -------------------------------------------------------------------------------- 1 | require "active_support/inflector" 2 | 3 | module OpenTok 4 | # Represents an Experience Composer render of an OpenTok session. 5 | # See {https://tokbox.com/developer/guides/experience-composer/ Experience Composer}. 6 | # 7 | # @attr [string] id 8 | # The unique ID for the Experience Composer. 9 | # 10 | # @attr [string] session_id 11 | # The session ID of the OpenTok session associated with this render. 12 | # 13 | # @attr [string] project_id 14 | # The API key associated with the render. 15 | # 16 | # @attr [int] created_at 17 | # The time the Experience Composer started, expressed in milliseconds since the Unix epoch. 18 | # 19 | # @attr [int] updated_at 20 | # The UNIX timestamp when the Experience Composer status was last updated. 21 | # 22 | # @attr [string] url 23 | # A publicly reachable URL controlled by the customer and capable of generating the content to be rendered without user intervention. 24 | # 25 | # @attr [string] resolution 26 | # The resolution of the Experience Composer (either "640x480", "480x640", "1280x720", "720x1280", "1920x1080", or "1080x1920"). 27 | # 28 | # @attr [string] status 29 | # The status of the Experience Composer. Poll frequently to check status updates. This property set to one of the following: 30 | # - "starting" — The Vonage Video API platform is in the process of connecting to the remote application at the URL provided. This is the initial state. 31 | # - "started" — The Vonage Video API platform has successfully connected to the remote application server, and is publishing the web view to an OpenTok stream. 32 | # - "stopped" — The Experience Composer has stopped. 33 | # - "failed" — An error occurred and the Experience Composer could not proceed. It may occur at startup if the OpenTok server cannot connect to the remote 34 | # application server or republish the stream. It may also occur at any point during the process due to an error in the Vonage Video API platform. 35 | # 36 | # @attr [string] reason 37 | # The reason field is only available when the status is either "stopped" or "failed". If the status is stopped, the reason field will contain either 38 | # "Max Duration Exceeded" or "Stop Requested." If the status is failed, the reason will contain a more specific error message. 39 | # 40 | # @attr [string] streamId 41 | # The ID of the composed stream being published. The streamId is not available when the status is "starting" and may not be available when the status is "failed". 42 | class Render 43 | 44 | # @private 45 | def initialize(interface, json) 46 | @interface = interface 47 | # TODO: validate json fits schema 48 | @json = json 49 | end 50 | 51 | # A JSON-encoded string representation of the Experience Composer render. 52 | def to_json 53 | @json.to_json 54 | end 55 | 56 | # Stops the OpenTok Experience Composer render. 57 | def stop 58 | # TODO: validate returned json fits schema 59 | @json = @interface.stop @json['id'] 60 | end 61 | 62 | # Gets info about the OpenTok Experience Composer render. 63 | def info 64 | # TODO: validate returned json fits schema 65 | @json = @interface.find @json['id'] 66 | end 67 | 68 | # @private ignore 69 | def method_missing(method, *args, &block) 70 | camelized_method = method.to_s.camelize(:lower) 71 | if @json.has_key? camelized_method and args.empty? 72 | @json[camelized_method] 73 | else 74 | super method, *args, &block 75 | end 76 | end 77 | end 78 | end 79 | -------------------------------------------------------------------------------- /lib/opentok/render_list.rb: -------------------------------------------------------------------------------- 1 | require "opentok/render" 2 | 3 | module OpenTok 4 | # A class for accessing an array of Experience Composer Render objects. 5 | class RenderList < Array 6 | # The total number of Experience Composer renders. 7 | attr_reader :total 8 | 9 | def initialize(interface, json) 10 | @total = json["count"] 11 | super json["items"].map { |item| ::OpenTok::Render.new interface, item } 12 | end 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /lib/opentok/signals.rb: -------------------------------------------------------------------------------- 1 | module OpenTok 2 | # A class for working with OpenTok signals. 3 | class Signals 4 | # @private 5 | def initialize(client) 6 | @client = client 7 | end 8 | 9 | # Sends a signal to clients connected to an OpenTok session. 10 | # 11 | # You can send a signal to all valid connections in a session or to a specific connection of 12 | # a session. 13 | # 14 | # For more information on signaling, see 15 | # {https://tokbox.com/developer/rest/#send_signal}. 16 | # 17 | # @param [String] session_id The session ID of the OpenTok session. 18 | # 19 | # @param [String] connection_id 20 | # When a connection_id is specified, only that connection recieves the signal. 21 | # Otherwise, the signal is sent to all clients connected to the session. 22 | # 23 | # @option options [String] :type This is the type of the signal. You can use this 24 | # field to group and filter signals. It is a property of the Signal object received by 25 | # the client(s). 26 | # 27 | # @option options [String] :data This is the data within the signal or the payload. 28 | # Contains the main information to be sent in the signal. It is a property of the Signal object 29 | # received by the client(s). 30 | # 31 | # @raise [ArgumentError] 32 | # One of the signal properties — data, type, session_id, or connection_id — is invalid. 33 | # @raise [OpenTokAuthenticationError] 34 | # You are not authorized to send the signal. Check your authentication credentials. 35 | # @raise [OpenTokError] 36 | # The client specified by the connection_id property is not connected to the session. 37 | # @raise [OpenTokError] 38 | # The type string exceeds the maximum length (128 bytes), or the data string exceeds 39 | # the maximum size (8 kB). 40 | def send(session_id, connectionId = "", options = {}) 41 | raise ArgumentError, "session_id not provided" if session_id.to_s.empty? 42 | response = @client.signal(session_id, connectionId, options) 43 | (200..300).include? response.code 44 | end 45 | 46 | end 47 | end -------------------------------------------------------------------------------- /lib/opentok/stream.rb: -------------------------------------------------------------------------------- 1 | require "active_support/inflector" 2 | 3 | module OpenTok 4 | # Represents information about a stream in an OpenTok session. 5 | # 6 | # @attr [string] id 7 | # The stream ID. 8 | # 9 | # @attr [string] name 10 | # The name of the stream. 11 | 12 | # @attr [string] videoType 13 | # The videoType property is either "camera" or "screen". 14 | # 15 | # @attr [array] layoutClassList 16 | # An array of the layout classes for the stream. 17 | class Stream 18 | 19 | # @private 20 | def initialize(json) 21 | # TODO: validate json fits schema 22 | @json = json 23 | end 24 | 25 | # A JSON-encoded string representation of the stream. 26 | def to_json 27 | @json.to_json 28 | end 29 | 30 | 31 | # @private ignore 32 | def method_missing(method, *args, &block) 33 | camelized_method = method.to_s.camelize(:lower) 34 | if @json.has_key? camelized_method and args.empty? 35 | # TODO: convert create_time method call to a Time object 36 | if camelized_method == 'outputMode' 37 | @json[camelized_method].to_sym 38 | else 39 | @json[camelized_method] 40 | end 41 | else 42 | super method, *args, &block 43 | end 44 | end 45 | end 46 | end 47 | -------------------------------------------------------------------------------- /lib/opentok/stream_list.rb: -------------------------------------------------------------------------------- 1 | require "opentok/stream" 2 | 3 | 4 | module OpenTok 5 | # A class for accessing a list of Stream objects. 6 | class StreamList < Array 7 | 8 | # The total number streams. 9 | attr_reader :total 10 | 11 | # @private 12 | def initialize(json) 13 | @total = json['count'] 14 | super json['items'].map { |item| Stream.new item } 15 | end 16 | 17 | end 18 | end -------------------------------------------------------------------------------- /lib/opentok/version.rb: -------------------------------------------------------------------------------- 1 | module OpenTok 2 | # @private 3 | VERSION = '4.12.0' 4 | end 5 | -------------------------------------------------------------------------------- /lib/opentok/websocket.rb: -------------------------------------------------------------------------------- 1 | require "opentok/client" 2 | 3 | # An object that lets you work with Audio Connector WebSocket connections. 4 | module OpenTok 5 | class WebSocket 6 | # Starts an Audio Connector WebSocket connection to send audio from a Vonage Video API session to a WebSocket URI. 7 | # See the {https://tokbox.com/developer/guides/audio-connector/ OpenTok Audio Connector developer guide}. 8 | # 9 | # @example 10 | # opts = { 11 | # "streams" => ["STREAMID1", "STREAMID2"], 12 | # "headers" => { 13 | # "key1" => "val1", 14 | # "key2" => "val2" 15 | # } 16 | # } 17 | # response = opentok.websocket.connect(SESSIONID, TOKEN, "ws://service.com/wsendpoint", opts) 18 | # 19 | # @param [String] session_id (required) The OpenTok session ID that includes the OpenTok streams you want to include in 20 | # the WebSocket stream. 21 | # @param [String] token (required) The OpenTok token to be used for the Audio Connector connection to the. OpenTok session. 22 | # @param [String] websocket_uri (required) A publicly reachable WebSocket URI to be used for the destination of the audio 23 | # stream (such as "wss://service.com/ws-endpoint"). 24 | # @param [Hash] opts (optional) A hash defining options for the Audio Connector WebSocket connection. For example: 25 | # @option opts [Array] :streams (optional) An array of stream IDs for the OpenTok streams you want to include in the WebSocket stream. 26 | # If you omit this property, all streams in the session will be included. 27 | # @option opts [Hash] :headers (optional) A hash of key-value pairs of headers to be sent to your WebSocket server with each message, 28 | # with a maximum length of 512 bytes. 29 | def connect(session_id, token, websocket_uri, opts = {}) 30 | response = @client.connect_websocket(session_id, token, websocket_uri, opts) 31 | end 32 | 33 | def initialize(client) 34 | @client = client 35 | end 36 | end 37 | end 38 | -------------------------------------------------------------------------------- /opentok.gemspec: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | require File.expand_path("../lib/opentok/version.rb", __FILE__) 3 | 4 | Gem::Specification.new do |spec| 5 | spec.name = "opentok" 6 | spec.version = OpenTok::VERSION 7 | spec.authors = ["Stijn Mathysen", "Karmen Blake", "Song Zheng", "Patrick Quinn-Graham", "Ankur Oberoi"] 8 | spec.email = ["stijn@skylight.be", "karmenblake@gmail.com", "song@tokbox.com", "pqg@tokbox.com", "ankur@tokbox.com"] 9 | spec.summary = %q{Ruby gem for the OpenTok API} 10 | spec.description = %q{OpenTok is an API from TokBox that enables websites to weave live group video communication into their online experience. With OpenTok you have the freedom and flexibility to create the most engaging web experience for your users. This gem lets you generate sessions and tokens for OpenTok applications. It also includes support for working with OpenTok 2.0 archives. See for more details.} 11 | # TODO: this homepage isn't set up just yet 12 | spec.homepage = "https://opentok.github.io/opentok-ruby-sdk" 13 | spec.metadata = { "source_code_uri" => "https://github.com/opentok/OpenTok-Ruby-SDK" } 14 | spec.license = "MIT" 15 | 16 | spec.files = `git ls-files -z`.split("\x0") 17 | spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) } 18 | spec.test_files = spec.files.grep(%r{^(test|spec|features)/}) 19 | 20 | bundler_version = RUBY_VERSION < '2.1' ? '~> 1.5' : '>= 1.5' 21 | spec.add_development_dependency "bundler", bundler_version 22 | spec.add_development_dependency "rake", "~> 12.3.3" 23 | spec.add_development_dependency "rspec", "~> 3.9.0" 24 | spec.add_development_dependency "webmock", ">= 2.3.2" 25 | spec.add_development_dependency "vcr", ">= 2.8.0" 26 | spec.add_development_dependency "yard", ">= 0.9.11" 27 | # TODO: exclude this for compatibility with rbx 28 | # spec.add_development_dependency "debugger", "~> 1.6.6" 29 | 30 | spec.add_dependency "addressable", "~> 2.3" # 2.3.0 <= version < 3.0.0 31 | spec.add_dependency "httparty", ">= 0.18.0" 32 | spec.add_dependency "activesupport", ">= 2.0" 33 | spec.add_dependency "jwt", ">= 1.5.6" 34 | end 35 | -------------------------------------------------------------------------------- /sample/Archiving/Gemfile: -------------------------------------------------------------------------------- 1 | source "http://rubygems.org" 2 | 3 | gem "sinatra", "~> 1.4.4" 4 | gem "opentok", :path => "../../" 5 | -------------------------------------------------------------------------------- /sample/Archiving/archiving_sample.rb: -------------------------------------------------------------------------------- 1 | require 'sinatra/base' 2 | require 'opentok' 3 | 4 | raise "You must define API_KEY and API_SECRET environment variables" unless ENV.has_key?("API_KEY") && ENV.has_key?("API_SECRET") 5 | 6 | class ArchivingSample < Sinatra::Base 7 | 8 | set :api_key, ENV['API_KEY'] 9 | set :opentok, OpenTok::OpenTok.new(api_key, ENV['API_SECRET']) 10 | set :session, opentok.create_session(:media_mode => :routed) 11 | set :erb, :layout => :layout 12 | 13 | get '/' do 14 | erb :index 15 | end 16 | 17 | get '/host' do 18 | api_key = settings.api_key 19 | session_id = settings.session.session_id 20 | token = settings.opentok.generate_token(session_id, :role => :moderator) 21 | 22 | erb :host, :locals => { 23 | :api_key => api_key, 24 | :session_id => session_id, 25 | :token => token 26 | } 27 | end 28 | 29 | get '/participant' do 30 | api_key = settings.api_key 31 | session_id = settings.session.session_id 32 | token = settings.opentok.generate_token(session_id, :role => :moderator) 33 | 34 | erb :participant, :locals => { 35 | :api_key => api_key, 36 | :session_id => session_id, 37 | :token => token 38 | } 39 | end 40 | 41 | get '/history' do 42 | page = (params[:page] || "1").to_i 43 | offset = (page - 1) * 5 44 | archives = settings.opentok.archives.all(:offset => offset, :count => 5) 45 | 46 | show_previous = page > 1 ? '/history?page=' + (page-1).to_s : nil 47 | show_next = archives.total > (offset + 5) ? '/history?page=' + (page+1).to_s : nil 48 | 49 | erb :history, :locals => { 50 | :archives => archives, 51 | :show_previous => show_previous, 52 | :show_next => show_next 53 | } 54 | end 55 | 56 | get '/download/:archive_id' do 57 | archive = settings.opentok.archives.find(params[:archive_id]) 58 | redirect archive.url 59 | end 60 | 61 | post '/start' do 62 | archive = settings.opentok.archives.create settings.session.session_id, { 63 | :name => "Ruby Archiving Sample App", 64 | :output_mode => params[:output_mode], 65 | :has_audio => params[:has_audio] == "on", 66 | :has_video => params[:has_video] == "on" 67 | } 68 | body archive.to_json 69 | end 70 | 71 | get '/stop/:archive_id' do 72 | archive = settings.opentok.archives.stop_by_id(params[:archive_id]) 73 | body archive.to_json 74 | end 75 | 76 | get '/delete/:archive_id' do 77 | settings.opentok.archives.delete_by_id(params[:archive_id]) 78 | redirect '/history' 79 | end 80 | 81 | # start the server if ruby file executed directly 82 | run! if app_file == $0 83 | end 84 | -------------------------------------------------------------------------------- /sample/Archiving/public/css/sample.css: -------------------------------------------------------------------------------- 1 | /* Move down content because we have a fixed navbar that is 50px tall */ 2 | body { 3 | padding-top: 50px; 4 | padding-bottom: 20px; 5 | background-color: #F2F2F2; 6 | } 7 | 8 | /* Responsive: Portrait tablets and up */ 9 | @media screen and (min-width: 768px) { 10 | /* Remove padding from wrapping element since we kick in the grid classes here */ 11 | .body-content { 12 | padding: 0; 13 | } 14 | } 15 | 16 | #subscribers div { 17 | float: left; 18 | } 19 | 20 | .bump-me { 21 | padding-top: 40px; 22 | } 23 | -------------------------------------------------------------------------------- /sample/Archiving/public/img/archiving-off.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opentok/OpenTok-Ruby-SDK/6e6478c177ad6010fef1b248ec87a7df01ee1985/sample/Archiving/public/img/archiving-off.png -------------------------------------------------------------------------------- /sample/Archiving/public/img/archiving-on-idle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opentok/OpenTok-Ruby-SDK/6e6478c177ad6010fef1b248ec87a7df01ee1985/sample/Archiving/public/img/archiving-on-idle.png -------------------------------------------------------------------------------- /sample/Archiving/public/img/archiving-on-message.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opentok/OpenTok-Ruby-SDK/6e6478c177ad6010fef1b248ec87a7df01ee1985/sample/Archiving/public/img/archiving-on-message.png -------------------------------------------------------------------------------- /sample/Archiving/public/js/host.js: -------------------------------------------------------------------------------- 1 | var session = OT.initSession(apiKey, sessionId), 2 | publisher = OT.initPublisher('publisher'), 3 | archiveID = null; 4 | 5 | session.connect(token, function(error) { 6 | if (error) { 7 | console.error('Failed to connect', error); 8 | } else { 9 | session.publish(publisher, function(error) { 10 | if (error) { 11 | console.error('Failed to publish', error); 12 | } 13 | }); 14 | } 15 | }); 16 | 17 | session.on('streamCreated', function(event) { 18 | session.subscribe(event.stream, 'subscribers', { 19 | insertMode: 'append' 20 | }, function(error) { 21 | if (error) { 22 | console.error('Failed to subscribe', error); 23 | } 24 | }); 25 | }); 26 | 27 | session.on('archiveStarted', function(event) { 28 | archiveID = event.id; 29 | console.log('ARCHIVE STARTED'); 30 | $('.start').hide(); 31 | $('.stop').show(); 32 | disableForm(); 33 | }); 34 | 35 | session.on('archiveStopped', function(event) { 36 | archiveID = null; 37 | console.log('ARCHIVE STOPPED'); 38 | $('.start').show(); 39 | $('.stop').hide(); 40 | enableForm(); 41 | }); 42 | 43 | $(document).ready(function() { 44 | $('.start').click(function(event) { 45 | var options = $('.archive-options').serialize(); 46 | disableForm(); 47 | $.post('/start', options).fail(enableForm); 48 | }).show(); 49 | $('.stop').click(function(event){ 50 | $.get('stop/' + archiveID); 51 | }).hide(); 52 | }); 53 | 54 | 55 | function disableForm() { 56 | $('.archive-options-fields').attr('disabled', 'disabled'); 57 | } 58 | 59 | function enableForm() { 60 | $('.archive-options-fields').removeAttr('disabled'); 61 | } 62 | -------------------------------------------------------------------------------- /sample/Archiving/public/js/participant.js: -------------------------------------------------------------------------------- 1 | var session = OT.initSession(apiKey, sessionId), 2 | publisher = OT.initPublisher('publisher'); 3 | 4 | session.connect(token, function(error) { 5 | if (error) { 6 | console.error('Failed to connect', error); 7 | } else { 8 | session.publish(publisher, function(error) { 9 | if (error) { 10 | console.error('Failed to publish', error); 11 | } 12 | }); 13 | } 14 | }); 15 | 16 | session.on('streamCreated', function(event) { 17 | session.subscribe(event.stream, 'subscribers', { 18 | insertMode : 'append' 19 | }, function(error) { 20 | if (error) { 21 | console.error('Failed to subscribe', error); 22 | } 23 | }); 24 | }); 25 | -------------------------------------------------------------------------------- /sample/Archiving/views/history.erb: -------------------------------------------------------------------------------- 1 |
2 | 3 |
4 | 5 |
6 |
7 |

Past Recordings

8 |
9 |
10 | <% if archives.count > 0 %> 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | <% for item in archives %> 22 | 23 | 24 | 33 | 34 | 35 | 36 | 43 | 44 | 45 | <% end %> 46 | 47 |
 CreatedDurationStatus
25 | <% if (item.status == "available") && item.url && (item.url.length > 0) %> 26 | 27 | <% end %> 28 | <%= item.name || "Untitled" %> 29 | <% if (item.status == "available") && item.url && (item.url.length > 0) %> 30 | 31 | <% end %> 32 | <%= Time.at(item.created_at/1000).strftime("%B %e, %Y at %I:%M %p") %><%= item.duration %> seconds<%= item.status %> 37 | <% if item.status == "available" %> 38 | Delete 39 | <% else %> 40 |   41 | <% end %> 42 |
48 | <% else %> 49 |

50 | There are no archives currently. Try making one in the host view. 51 |

52 | <% end %> 53 |
54 | 63 |
64 |
65 |
66 | -------------------------------------------------------------------------------- /sample/Archiving/views/host.erb: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | 5 |
6 | 7 |
8 |
9 |

Host

10 |
11 |
12 |
13 |
14 | 42 |
43 |
44 | 45 |
46 |
47 |

Instructions

48 |
49 |
50 |

51 | Click Start archiving to begin archiving this session. 52 | All publishers in the session will be included, and all publishers that 53 | join the session will be included as well. 54 |

55 |

56 | Click Stop archiving to end archiving this session. 57 | You can then go to past archives to 58 | view your archive (once its status changes to available). 59 |

60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 |
WhenYou will see
Archiving is started
Archiving remains on
Archiving is stopped
82 |
83 |
84 |
85 | 86 | 91 | 92 | 93 | 94 | -------------------------------------------------------------------------------- /sample/Archiving/views/index.erb: -------------------------------------------------------------------------------- 1 |
2 | 3 | 4 |
5 | 6 | 7 |
8 |
9 | 10 |
11 |
Create an archive
12 |
13 |

14 | Everyone who joins either the Host View or Participant View 15 | joins a single OpenTok session. Anyone with the Host View 16 | open can click Start Archive or Stop Archive to control 17 | recording of the entire session. 18 |

19 |
20 | 24 |
25 | 26 |
27 |
28 | 29 |
30 |
Play an archive
31 |
32 |

33 | Click through to Past Archives to see examples of using the 34 | Archiving REST API to list archives showing status (started, 35 | stopped, available) and playback (for available archives). 36 |

37 |
38 | 41 |
42 | 43 |
44 |
45 | 46 |
47 | 48 |
49 | -------------------------------------------------------------------------------- /sample/Archiving/views/layout.erb: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Archiving Sample 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 24 | 25 | <%= yield %> 26 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /sample/Archiving/views/participant.erb: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | 5 |
6 | 7 |
8 |
9 |

Participant

10 |
11 |
12 |
13 |
14 |
15 |
16 | 17 |
18 |
19 |

Instructions

20 |
21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 |
WhenYou will see
Archiving is started
Archiving remains on
Archiving is stopped
44 |
45 |
46 |
47 | 48 | 53 | 54 | 55 | 56 | -------------------------------------------------------------------------------- /sample/Broadcast/Gemfile: -------------------------------------------------------------------------------- 1 | source "http://rubygems.org" 2 | 3 | gem "sinatra", "~> 1.4.4" 4 | gem "opentok", :path => "../../" 5 | -------------------------------------------------------------------------------- /sample/Broadcast/broadcast_sample.rb: -------------------------------------------------------------------------------- 1 | require 'sinatra/base' 2 | require 'opentok' 3 | 4 | raise "You must define API_KEY and API_SECRET environment variables" unless ENV.has_key?("API_KEY") && ENV.has_key?("API_SECRET") 5 | 6 | class BroadcastSample < Sinatra::Base 7 | 8 | set :api_key, ENV['API_KEY'] 9 | set :opentok, OpenTok::OpenTok.new(api_key, ENV['API_SECRET']) 10 | set :session, opentok.create_session(:media_mode => :routed) 11 | set :erb, :layout => :layout 12 | set :broadcast_id, nil 13 | set :focus_stream_id, '' 14 | set :broadcast_layout, 'horizontalPresentation' 15 | 16 | get '/' do 17 | erb :index 18 | end 19 | 20 | get '/host' do 21 | api_key = settings.api_key 22 | session_id = settings.session.session_id 23 | token = settings.opentok.generate_token(session_id, role: :publisher, initialLayoutClassList: ['focus']) 24 | 25 | erb :host, locals: { 26 | apiKey: api_key, 27 | sessionId: session_id, 28 | token: token, 29 | initialBroadcastId: settings.broadcast_id, 30 | focusStreamId: settings.focus_stream_id, 31 | initialLayout: settings.broadcast_layout 32 | } 33 | end 34 | 35 | get '/participant' do 36 | api_key = settings.api_key 37 | session_id = settings.session.session_id 38 | token = settings.opentok.generate_token(session_id, role: :publisher) 39 | 40 | erb :participant, locals: { 41 | apiKey: api_key, 42 | sessionId: session_id, 43 | token: token, 44 | focusStreamId: settings.focus_stream_id, 45 | layout: settings.broadcast_layout 46 | } 47 | end 48 | 49 | get '/all' do 50 | page = (params[:page] || "1").to_i 51 | offset = (page - 1) * 5 52 | broadcasts = settings.opentok.broadcasts.all(:offset => offset, :count => 5) 53 | 54 | show_previous = page > 1 ? '/all?page=' + (page-1).to_s : nil 55 | show_next = broadcasts.total > (offset + 5) ? '/all?page=' + (page+1).to_s : nil 56 | 57 | erb :all, :locals => { 58 | :broadcasts => broadcasts, 59 | :show_previous => show_previous, 60 | :show_next => show_next 61 | } 62 | end 63 | 64 | post '/start' do 65 | opts = { 66 | :maxDuration => params.key?("maxDuration") ? params[:maxDuration] : 7200, 67 | :resolution => params[:resolution], 68 | :layout => params[:layout], 69 | :outputs => { 70 | :hls => {} 71 | } 72 | } 73 | broadcast = settings.opentok.broadcasts.create(settings.session.session_id, opts) 74 | settings.broadcast_id = broadcast.id 75 | body broadcast.to_json 76 | end 77 | 78 | get '/broadcast' do 79 | return 'No broadcast id exists' if settings.broadcast_id.nil? || settings.broadcast_id.empty? 80 | broadcast = settings.opentok.broadcasts.find settings.broadcast_id 81 | redirect broadcast.broadcastUrls['hls'] if broadcast.status == 'started' 82 | end 83 | 84 | get '/stop/:broadcastId' do 85 | broadcast = settings.opentok.broadcasts.stop settings.broadcast_id 86 | settings.broadcast_id = nil 87 | settings.focus_stream_id = '' 88 | settings.broadcast_layout = 'horizontalPresentation' 89 | body broadcast.to_json 90 | end 91 | 92 | post '/broadcast/:broadcastId/layout' do 93 | layoutType = params[:type] 94 | settings.opentok.broadcasts.layout(settings.broadcast_id, type: layoutType) 95 | settings.broadcast_layout = layoutType 96 | end 97 | 98 | post '/focus' do 99 | hash = { items: [] } 100 | hash[:items] << { id: params[:focus], layoutClassList: ['focus'] } 101 | settings.focus_stream_id = params[:focus] 102 | if params.key?('otherStreams') 103 | params[:otherStreams].each do |stream| 104 | hash[:items] << { id: stream, layoutClassList: [] } 105 | end 106 | end 107 | settings.opentok.streams.layout(settings.session.session_id, hash) 108 | end 109 | 110 | # start the server if ruby file executed directly 111 | run! if app_file == $0 112 | end 113 | -------------------------------------------------------------------------------- /sample/Broadcast/public/css/sample.css: -------------------------------------------------------------------------------- 1 | /* Move down content because we have a fixed navbar that is 50px tall */ 2 | body { 3 | padding-top: 50px; 4 | padding-bottom: 20px; 5 | background-color: #F2F2F2; 6 | } 7 | 8 | /* Responsive: Portrait tablets and up */ 9 | @media screen and (min-width: 768px) { 10 | /* Remove padding from wrapping element since we kick in the grid classes here */ 11 | .body-content { 12 | padding: 0; 13 | } 14 | } 15 | 16 | #streams { 17 | background-color: gray; 18 | width: 320px; 19 | height: 180px; 20 | } 21 | 22 | #streams > div { 23 | width: 20%; 24 | height: 20%; 25 | float: left; 26 | position: relative; 27 | cursor: pointer; 28 | } 29 | 30 | #streams.vertical > div { 31 | left: 0px; 32 | clear: left; 33 | padding: 0px; 34 | } 35 | 36 | #streams .focus { 37 | position: relative; 38 | top: 0; 39 | left: 0; 40 | margin-top: 0; 41 | height: 100%; 42 | width: 100%; 43 | } 44 | 45 | #streams.vertical .focus { 46 | padding: 0; 47 | left: 0; 48 | margin: 0; 49 | left: 20%; 50 | height: 100%; 51 | width: 80%; 52 | } 53 | 54 | .stop { 55 | display: none; 56 | } 57 | 58 | .bump-me { 59 | padding-top: 40px; 60 | } 61 | 62 | .help-block { 63 | font-weight: bold; 64 | } 65 | -------------------------------------------------------------------------------- /sample/Broadcast/public/js/participant.js: -------------------------------------------------------------------------------- 1 | /* global OT, apiKey, sessionId, token, $, layout, focusStreamId */ 2 | var session = OT.initSession(apiKey, sessionId); 3 | var publisher; 4 | 5 | var container = $('
'); 6 | 7 | if (layout === 'verticalPresentation') { 8 | $('#streams').addClass('vertical'); 9 | } 10 | 11 | container.addClass('focus'); 12 | $('#streams').append(container); 13 | 14 | publisher = OT.initPublisher('publisher', { 15 | insertMode: 'append', 16 | width: '100%', 17 | height: '100%', 18 | resolution: '1280x720' 19 | }); 20 | 21 | function positionStreams() { 22 | var $focusElement = $('.focus'); 23 | if ($('#streams').hasClass('vertical')) { 24 | $focusElement.appendTo('#streams'); 25 | $('#streams').children().css('top', '0'); 26 | $focusElement.css('top', (-20 * ($('#streams').children().size() - 1)) + '%'); 27 | } 28 | else { 29 | $focusElement.prependTo('#streams'); 30 | $focusElement.css('top', '0'); 31 | } 32 | } 33 | 34 | function focusStream(streamId) { 35 | var focusStreamId = streamId; 36 | var $focusElement = (publisher.stream && publisher.stream.id === focusStreamId) ? $('#publisher') 37 | : $('#' + focusStreamId); 38 | $('.focus').removeClass('focus'); 39 | $focusElement.addClass('focus'); 40 | positionStreams(); 41 | } 42 | 43 | session.connect(token, function (err) { 44 | if (err) { 45 | alert(err.message || err); // eslint-disable-line no-alert 46 | } 47 | session.publish(publisher); 48 | }); 49 | 50 | session.on('streamCreated', function (event) { 51 | var streamId = event.stream.id; 52 | container = document.createElement('div'); 53 | container.id = streamId; 54 | $('#streams').append(container); 55 | session.subscribe(event.stream, streamId, { 56 | insertMode: 'append', 57 | width: '100%', 58 | height: '100%' 59 | }); 60 | if (streamId === focusStreamId) { 61 | focusStream(streamId); 62 | } 63 | positionStreams(); 64 | }); 65 | 66 | session.on('streamDestroyed', function (event) { 67 | $('#' + event.stream.id).remove(); 68 | positionStreams(); 69 | }); 70 | 71 | session.on('signal:layoutClass', function (event) { 72 | if (event.data === 'horizontalPresentation') { 73 | $('#streams').removeClass('vertical'); 74 | $('.focus').prependTo('#streams'); 75 | } 76 | else { 77 | $('#streams').addClass('vertical'); 78 | $('.focus').appendTo('#streams'); 79 | } 80 | positionStreams(); 81 | }); 82 | 83 | session.on('signal:focusStream', function (event) { 84 | focusStream(event.data); 85 | }); 86 | -------------------------------------------------------------------------------- /sample/Broadcast/views/all.erb: -------------------------------------------------------------------------------- 1 |
2 | 3 |
4 | 5 |
6 |
7 |

Broadcasts List

8 |
9 |
10 | <% if broadcasts.count > 0 %> 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | <% for item in broadcasts %> 20 | 21 | 22 | 23 | 24 | 25 | 26 | <% end %> 27 | 28 |
CreatedStatus
<%= Time.at(item.created_at/1000).strftime("%B %e, %Y at %I:%M %p") %><%= item.status %>
29 | <% else %> 30 |

31 | There are no broadcasts currently. Try making one in the host view. 32 |

33 | <% end %> 34 |
35 | 44 |
45 |
46 |
47 | -------------------------------------------------------------------------------- /sample/Broadcast/views/host.erb: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |
5 | 6 |
7 | 8 |
9 |
10 |

Host

11 |
12 |
13 |
14 |
15 |
16 |
17 | 45 |
46 |
47 | 48 |
49 |
50 |

Instructions

51 |
52 |
53 |

54 | Click Start broadcast to start broadcasting this session. 55 | All publishers in the session will be included, and all publishers that 56 | join the session will be included as well. 57 |

58 |

59 | Click Stop broadcast to stop broadcasting this session. 60 |

61 |

62 | Click Toggle layout to toggle the layout 63 | between a vertical and horizontal presentation. The layout changes in all clients 64 | and in the broadcast. 65 |

66 | Click any stream to set it to be the focus stream in the broadcast layout. 67 |

68 |
69 |
70 | 71 | 79 | 80 | 81 | 82 | 83 | -------------------------------------------------------------------------------- /sample/Broadcast/views/index.erb: -------------------------------------------------------------------------------- 1 |
2 | 3 | 4 |
5 | 6 | 7 |
8 |
9 | 10 |
11 |
Create a broadcast
12 |
13 |

14 | Everyone who joins either the Host View or Participant View 15 | joins a single OpenTok session. The Host can click 16 | Start Broadcast and Stop Broadcast to control the live streaming 17 | broadcast of the entire session. 18 |

19 |
20 | 25 |
26 | 27 |
28 |
29 | 30 |
31 |
List of Broadcasts
32 |
33 |

34 | Click through to List of Broadcasts to see examples of using the 35 | Broadcasting REST API to list broadcasts showing status (started, 36 | stopped, available) and created at timestamp. 37 |

38 |
39 | 42 |
43 | 44 |
45 | 46 |
47 |
48 | -------------------------------------------------------------------------------- /sample/Broadcast/views/layout.erb: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Broadcast Sample 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 24 | 25 | <%= yield %> 26 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /sample/Broadcast/views/participant.erb: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | 5 |
6 | 7 |
8 |
9 |

Participant

10 |
11 |
12 |
13 |
14 |
15 |
16 | 17 | 24 | 25 | 26 |
27 | 28 | -------------------------------------------------------------------------------- /sample/HelloWorld/Gemfile: -------------------------------------------------------------------------------- 1 | source "http://rubygems.org" 2 | 3 | gem "sinatra", "~> 1.4.4" 4 | gem "opentok", :path => "../../" 5 | -------------------------------------------------------------------------------- /sample/HelloWorld/hello_world.rb: -------------------------------------------------------------------------------- 1 | require 'sinatra/base' 2 | require 'opentok' 3 | 4 | raise "You must define API_KEY and API_SECRET environment variables" unless ENV.has_key?("API_KEY") && ENV.has_key?("API_SECRET") 5 | 6 | class HelloWorld < Sinatra::Base 7 | 8 | set :api_key, ENV['API_KEY'] 9 | set :opentok, OpenTok::OpenTok.new(api_key, ENV['API_SECRET']) 10 | set :session, opentok.create_session 11 | 12 | get '/' do 13 | 14 | api_key = settings.api_key 15 | session_id = settings.session.session_id 16 | token = settings.opentok.generate_token(session_id) 17 | 18 | erb :index, :locals => { 19 | :api_key => api_key, 20 | :session_id => session_id, 21 | :token => token 22 | } 23 | end 24 | 25 | # start the server if ruby file executed directly 26 | run! if app_file == $0 27 | end 28 | -------------------------------------------------------------------------------- /sample/HelloWorld/public/js/helloworld.js: -------------------------------------------------------------------------------- 1 | // Initialize an OpenTok Session object 2 | var session = OT.initSession(apiKey, sessionId); 3 | 4 | // Initialize a Publisher, and place it into the element with id="publisher" 5 | var publisher = OT.initPublisher('publisher', { 6 | insertMode: 'append', 7 | }, function(error) { 8 | if (error) { 9 | console.error('Failed to initialise publisher', error); 10 | } 11 | }); 12 | 13 | // Attach event handlers 14 | session.on({ 15 | 16 | // This function runs when session.connect() asynchronously completes 17 | sessionConnected: function(event) { 18 | // Publish the publisher we initialzed earlier (this will trigger 'streamCreated' on other 19 | // clients) 20 | session.publish(publisher, function(error) { 21 | if (error) { 22 | console.error('Failed to publish', error); 23 | } 24 | }); 25 | }, 26 | 27 | // This function runs when another client publishes a stream (eg. session.publish()) 28 | streamCreated: function(event) { 29 | // Subscribe to the stream that caused this event, and place it into the element with id="subscribers" 30 | session.subscribe(event.stream, 'subscribers', { 31 | insertMode: 'append', 32 | }, function(error) { 33 | if (error) { 34 | console.error('Failed to subscribe', error); 35 | } 36 | }); 37 | } 38 | 39 | }); 40 | 41 | // Connect to the Session using a 'token' 42 | session.connect(token, function(error) { 43 | if (error) { 44 | console.error('Failed to connect', error); 45 | } 46 | }); 47 | -------------------------------------------------------------------------------- /sample/HelloWorld/views/index.erb: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | OpenTok Hello World 6 | 7 | 12 | 13 | 14 |

Hello, World!

15 |
16 |
17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /spec/cassettes/OpenTok_Archives/adds_a_stream_to_an_archive.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: patch 5 | uri: https://api.opentok.com/v2/project/123456/archive/30b3ebf1-ba36-4f5b-8def-6f70d9986fe9/streams 6 | body: 7 | encoding: UTF-8 8 | string: '{"addStream":"12312312-3811-4726-b508-e41a0f96c68f"}' 9 | headers: 10 | User-Agent: 11 | - OpenTok-Ruby-SDK/<%= version %> 12 | X-Opentok-Auth: 13 | - eyJpc3QiOiJwcm9qZWN0IiwiYWxnIjoiSFMyNTYifQ.eyJpc3MiOiIxMjM0NTYiLCJpYXQiOjE0OTI1MTA2NjAsImV4cCI6MTQ5MjUxMDk2MH0.BplMVhJWx4ld7KLKXqEmow6MjNPPFw9W8IHCMfeb120 14 | Content-Type: 15 | - application/json 16 | Accept-Encoding: 17 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 18 | Accept: 19 | - "*/*" 20 | response: 21 | status: 22 | code: 204 23 | message: No Content 24 | headers: 25 | Server: 26 | - nginx 27 | Date: 28 | - Tue, 23 Nov 2021 20:55:02 GMT 29 | Connection: 30 | - keep-alive 31 | Set-Cookie: 32 | - AWSALBTG=DuFUMmWLYpV+WXygU/vIF2GeEgO0ltb32OLXKREBQ059UXSGx826MWScm3+Iba9R/DrIu8wi8puQQB6HMDNNA5twML8KpmSno/CfRqigVEW7z7njwLdBeIjKowkK2oDiRCpWwn35G08EcNtdzJZUUO+Cqt/7MLfakD0RjBHzn0k0H6uk8Y4=; 33 | Expires=Tue, 30 Nov 2021 20:55:02 GMT; Path=/ 34 | - AWSALBTGCORS=DuFUMmWLYpV+WXygU/vIF2GeEgO0ltb32OLXKREBQ059UXSGx826MWScm3+Iba9R/DrIu8wi8puQQB6HMDNNA5twML8KpmSno/CfRqigVEW7z7njwLdBeIjKowkK2oDiRCpWwn35G08EcNtdzJZUUO+Cqt/7MLfakD0RjBHzn0k0H6uk8Y4=; 35 | Expires=Tue, 30 Nov 2021 20:55:02 GMT; Path=/; SameSite=None; Secure 36 | recorded_at: Tue, 18 Apr 2017 10:17:40 GMT 37 | recorded_with: VCR 6.0.0 38 | -------------------------------------------------------------------------------- /spec/cassettes/OpenTok_Archives/calls_layout_on_archive_object.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: get 5 | uri: https://api.opentok.com/v2/project/123456/archive/f6e7ee58-d6cf-4a59-896b-6d56b158ec71 6 | body: 7 | encoding: US-ASCII 8 | string: '' 9 | headers: 10 | User-Agent: 11 | - OpenTok-Ruby-SDK/<%= version %> 12 | X-Opentok-Auth: 13 | - eyJpc3QiOiJwcm9qZWN0IiwiYWxnIjoiSFMyNTYifQ.eyJpc3MiOiIxMjM0NTYiLCJpYXQiOjE0OTI1MTA2NjAsImV4cCI6MTQ5MjUxMDk2MH0.BplMVhJWx4ld7KLKXqEmow6MjNPPFw9W8IHCMfeb120 14 | Accept-Encoding: "gzip;q=1.0,deflate;q=0.6,identity;q=0.3" 15 | Accept: "*/*" 16 | response: 17 | status: 18 | code: 200 19 | message: OK 20 | headers: 21 | Server: 22 | - nginx 23 | Date: 24 | - Wed, 26 Sep 2018 18:07:55 GMT 25 | Content-Type: 26 | - application/json 27 | Connection: 28 | - keep-alive 29 | body: 30 | encoding: UTF-8 31 | string: |- 32 | { 33 | "createdAt" : 1395187836000, 34 | "duration" : 62, 35 | "id" : "f6e7ee58-d6cf-4a59-896b-6d56b158ec71", 36 | "name" : "", 37 | "partnerId" : 123456, 38 | "reason" : "", 39 | "sessionId" : "SESSIONID", 40 | "size" : 8347554, 41 | "status" : "available", 42 | "url" : "http://tokbox.com.archive2.s3.amazonaws.com/123456%2Ff6e7ee58-d6cf-4a59-896b-6d56b158ec71%2Farchive.mp4?Expires=1395194362&AWSAccessKeyId=AKIAI6LQCPIXYVWCQV6Q&Signature=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", 43 | "notarealproperty" : "not a real value" 44 | } 45 | http_version: 46 | recorded_at: Tue, 18 Apr 2017 10:17:40 GMT 47 | recorded_with: VCR 2.8.0 48 | -------------------------------------------------------------------------------- /spec/cassettes/OpenTok_Archives/changes_the_layout_of_an_archive.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: put 5 | uri: https://api.opentok.com/v2/project/123456/archive/30b3ebf1-ba36-4f5b-8def-6f70d9986fe9/layout 6 | body: 7 | encoding: US-ASCII 8 | string: '{"type":"pip"}' 9 | headers: 10 | User-Agent: 11 | - OpenTok-Ruby-SDK/<%= version %> 12 | X-Opentok-Auth: 13 | - eyJpc3QiOiJwcm9qZWN0IiwiYWxnIjoiSFMyNTYifQ.eyJpc3MiOiIxMjM0NTYiLCJpYXQiOjE0OTI1MTA2NjAsImV4cCI6MTQ5MjUxMDk2MH0.BplMVhJWx4ld7KLKXqEmow6MjNPPFw9W8IHCMfeb120 14 | Content-Type: 15 | - application/json 16 | Accept-Encoding: "gzip;q=1.0,deflate;q=0.6,identity;q=0.3" 17 | Accept: "*/*" 18 | response: 19 | status: 20 | code: 200 21 | message: OK 22 | headers: 23 | Server: 24 | - nginx 25 | Date: 26 | - Wed, 26 Sep 2018 18:22:36 GMT 27 | Content-Type: 28 | - application/json 29 | Connection: 30 | - keep-alive 31 | Content-Length: 32 | - '73' 33 | body: 34 | encoding: UTF-8 35 | string: '{"code":-1,"message":"Issuer not found","description":"Issuer not found"}' 36 | http_version: 37 | recorded_at: Tue, 18 Apr 2017 10:17:40 GMT 38 | recorded_with: VCR 2.8.0 39 | -------------------------------------------------------------------------------- /spec/cassettes/OpenTok_Archives/http_client_errors/.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: get 5 | uri: https://api.opentok.com/v2/project/123456/archive 6 | body: 7 | encoding: US-ASCII 8 | string: '' 9 | headers: 10 | User-Agent: 11 | - OpenTok-Ruby-SDK/4.0.0-Ruby-Version-2.6.3-p62 12 | X-Opentok-Auth: 13 | - eyJpc3QiOiJwcm9qZWN0IiwiYWxnIjoiSFMyNTYifQ.eyJpc3MiOiIxMjM0NTYiLCJpYXQiOjE0OTI1MTA2NjAsImV4cCI6MTQ5MjUxMDk2MH0.BplMVhJWx4ld7KLKXqEmow6MjNPPFw9W8IHCMfeb120 14 | response: 15 | status: 16 | code: 403 17 | message: Forbidden 18 | headers: 19 | Server: 20 | - nginx 21 | Date: 22 | - Fri, 06 Dec 2019 18:42:19 GMT 23 | Content-Type: 24 | - application/json 25 | Connection: 26 | - keep-alive 27 | Content-Length: 28 | - '73' 29 | body: 30 | encoding: UTF-8 31 | string: '{"code":-1,"message":"Issuer not found","description":"Issuer not found"}' 32 | http_version: 33 | recorded_at: Tue, 18 Apr 2017 10:17:40 GMT 34 | recorded_with: VCR 5.0.0 35 | -------------------------------------------------------------------------------- /spec/cassettes/OpenTok_Archives/removes_a_stream_from_an_archive.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: patch 5 | uri: https://api.opentok.com/v2/project/123456/archive/30b3ebf1-ba36-4f5b-8def-6f70d9986fe9/streams 6 | body: 7 | encoding: UTF-8 8 | string: '{"removeStream":"12312312-3811-4726-b508-e41a0f96c68f"}' 9 | headers: 10 | User-Agent: 11 | - OpenTok-Ruby-SDK/<%= version %> 12 | X-Opentok-Auth: 13 | - eyJpc3QiOiJwcm9qZWN0IiwiYWxnIjoiSFMyNTYifQ.eyJpc3MiOiIxMjM0NTYiLCJpYXQiOjE0OTI1MTA2NjAsImV4cCI6MTQ5MjUxMDk2MH0.BplMVhJWx4ld7KLKXqEmow6MjNPPFw9W8IHCMfeb120 14 | Content-Type: 15 | - application/json 16 | Accept-Encoding: 17 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 18 | Accept: 19 | - "*/*" 20 | response: 21 | status: 22 | code: 204 23 | message: No Content 24 | headers: 25 | Server: 26 | - nginx 27 | Date: 28 | - Tue, 23 Nov 2021 20:55:03 GMT 29 | Connection: 30 | - keep-alive 31 | Set-Cookie: 32 | - AWSALBTG=C8HtbnHIrXFPcTucK+6zVh2r0MMrr/1Jb/WUzPKk5rAEw3LbnvwxrsMlwebeHFPZUj+lcnVMLZU91OiujdiYEUH5eBovMivdAk9Gd/O9f4iPju70zwCPrRaoMZnH3sFK6a8lG3Q966pXth4vEsvTA12tADiC2emPHC51Z75R51aQMKUxFPc=; 33 | Expires=Tue, 30 Nov 2021 20:55:03 GMT; Path=/ 34 | - AWSALBTGCORS=C8HtbnHIrXFPcTucK+6zVh2r0MMrr/1Jb/WUzPKk5rAEw3LbnvwxrsMlwebeHFPZUj+lcnVMLZU91OiujdiYEUH5eBovMivdAk9Gd/O9f4iPju70zwCPrRaoMZnH3sFK6a8lG3Q966pXth4vEsvTA12tADiC2emPHC51Z75R51aQMKUxFPc=; 35 | Expires=Tue, 30 Nov 2021 20:55:03 GMT; Path=/; SameSite=None; Secure 36 | recorded_at: Tue, 18 Apr 2017 10:17:40 GMT 37 | recorded_with: VCR 6.0.0 38 | -------------------------------------------------------------------------------- /spec/cassettes/OpenTok_Archives/should_create_an_archive_with_matching_multi_archive_tag_when_multiArchiveTag_is_specified.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://api.opentok.com/v2/project/123456/archive 6 | body: 7 | encoding: UTF-8 8 | string: '{"sessionId":"SESSIONID","multiArchiveTag":"archive-1"}' 9 | headers: 10 | User-Agent: 11 | - OpenTok-Ruby-SDK/<%= version %> 12 | X-Opentok-Auth: 13 | - eyJpc3QiOiJwcm9qZWN0IiwiYWxnIjoiSFMyNTYifQ.eyJpc3MiOiIxMjM0NTYiLCJpYXQiOjE0OTI1MTA2NjAsImV4cCI6MTQ5MjUxMDk2MH0.BplMVhJWx4ld7KLKXqEmow6MjNPPFw9W8IHCMfeb120 14 | Content-Type: 15 | - application/json 16 | Accept-Encoding: 17 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 18 | Accept: 19 | - "*/*" 20 | response: 21 | status: 22 | code: 200 23 | message: OK 24 | headers: 25 | Server: 26 | - nginx 27 | Date: 28 | - Mon, 03 Oct 2022 10:19:16 GMT 29 | Content-Type: 30 | - application/json; charset=utf-8 31 | Connection: 32 | - keep-alive 33 | body: 34 | encoding: UTF-8 35 | string: |- 36 | { 37 | "createdAt" : 1395183243556, 38 | "duration" : 0, 39 | "id" : "30b3ebf1-ba36-4f5b-8def-6f70d9986fe9", 40 | "name" : "", 41 | "partnerId" : 123456, 42 | "reason" : "", 43 | "sessionId" : "SESSIONID", 44 | "size" : 0, 45 | "status" : "started", 46 | "url" : null, 47 | "multiArchiveTag":"archive-1" 48 | } 49 | recorded_at: Tue, 18 Apr 2017 10:17:40 GMT 50 | recorded_with: VCR 6.0.0 51 | -------------------------------------------------------------------------------- /spec/cassettes/OpenTok_Archives/should_create_an_archive_with_maxBitrate_set_to_specified_max_bitrate_value.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://api.opentok.com/v2/project/123456/archive 6 | body: 7 | encoding: UTF-8 8 | string: '{"sessionId":"SESSIONID","maxBitrate":200000}' 9 | headers: 10 | User-Agent: 11 | - OpenTok-Ruby-SDK/<%= version %> 12 | X-Opentok-Auth: 13 | - eyJpc3QiOiJwcm9qZWN0IiwiYWxnIjoiSFMyNTYifQ.eyJpc3MiOiIxMjM0NTYiLCJpYXQiOjE0OTI1MTA2NjAsImV4cCI6MTQ5MjUxMDk2MH0.BplMVhJWx4ld7KLKXqEmow6MjNPPFw9W8IHCMfeb120 14 | Content-Type: 15 | - application/json 16 | Accept-Encoding: 17 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 18 | Accept: 19 | - "*/*" 20 | response: 21 | status: 22 | code: 200 23 | message: OK 24 | headers: 25 | Server: 26 | - nginx 27 | Date: 28 | - Fri, 07 Feb 2025 12:17:20 GMT 29 | Content-Type: 30 | - application/json 31 | Transfer-Encoding: 32 | - chunked 33 | Connection: 34 | - keep-alive 35 | body: 36 | encoding: UTF-8 37 | string: |- 38 | { 39 | "createdAt" : 1395183243556, 40 | "duration" : 0, 41 | "id" : "30b3ebf1-ba36-4f5b-8def-6f70d9986fe9", 42 | "name" : "", 43 | "partnerId" : 123456, 44 | "reason" : "", 45 | "sessionId" : "SESSIONID", 46 | "size" : 0, 47 | "status" : "started", 48 | "url" : null, 49 | "maxBitrate": 200000 50 | } 51 | recorded_at: Fri, 07 Feb 2025 12:17:20 GMT 52 | recorded_with: VCR 6.0.0 53 | -------------------------------------------------------------------------------- /spec/cassettes/OpenTok_Archives/should_create_an_archive_with_multi_archive_tag_value_of_nil_when_multiArchiveTag_not_specified.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://api.opentok.com/v2/project/123456/archive 6 | body: 7 | encoding: UTF-8 8 | string: '{"sessionId":"SESSIONID"}' 9 | headers: 10 | User-Agent: 11 | - OpenTok-Ruby-SDK/<%= version %> 12 | X-Opentok-Auth: 13 | - eyJpc3QiOiJwcm9qZWN0IiwiYWxnIjoiSFMyNTYifQ.eyJpc3MiOiIxMjM0NTYiLCJpYXQiOjE0OTI1MTA2NjAsImV4cCI6MTQ5MjUxMDk2MH0.BplMVhJWx4ld7KLKXqEmow6MjNPPFw9W8IHCMfeb120 14 | Content-Type: 15 | - application/json 16 | Accept-Encoding: 17 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 18 | Accept: 19 | - "*/*" 20 | response: 21 | status: 22 | code: 200 23 | message: OK 24 | headers: 25 | Server: 26 | - nginx 27 | Date: 28 | - Mon, 03 Oct 2022 10:19:17 GMT 29 | Content-Type: 30 | - application/json; charset=utf-8 31 | Connection: 32 | - keep-alive 33 | body: 34 | encoding: UTF-8 35 | string: |- 36 | { 37 | "createdAt" : 1395183243556, 38 | "duration" : 0, 39 | "id" : "30b3ebf1-ba36-4f5b-8def-6f70d9986fe9", 40 | "name" : "", 41 | "partnerId" : 123456, 42 | "reason" : "", 43 | "sessionId" : "SESSIONID", 44 | "size" : 0, 45 | "status" : "started", 46 | "url" : null 47 | } 48 | recorded_at: Tue, 18 Apr 2017 10:17:40 GMT 49 | recorded_with: VCR 6.0.0 50 | -------------------------------------------------------------------------------- /spec/cassettes/OpenTok_Archives/should_create_an_archive_with_streamMode_set_to_specified_stream_mode_value.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://api.opentok.com/v2/project/123456/archive 6 | body: 7 | encoding: UTF-8 8 | string: '{"sessionId":"SESSIONID","streamMode":"manual"}' 9 | headers: 10 | User-Agent: 11 | - OpenTok-Ruby-SDK/<%= version %> 12 | X-Opentok-Auth: 13 | - eyJpc3QiOiJwcm9qZWN0IiwiYWxnIjoiSFMyNTYifQ.eyJpc3MiOiIxMjM0NTYiLCJpYXQiOjE0OTI1MTA2NjAsImV4cCI6MTQ5MjUxMDk2MH0.BplMVhJWx4ld7KLKXqEmow6MjNPPFw9W8IHCMfeb120 14 | Content-Type: 15 | - application/json 16 | Accept-Encoding: 17 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 18 | Accept: 19 | - "*/*" 20 | response: 21 | status: 22 | code: 200 23 | message: OK 24 | headers: 25 | Server: 26 | - nginx 27 | Date: 28 | - Wed, 03 Jan 2024 14:32:20 GMT 29 | Content-Type: 30 | - application/json 31 | Transfer-Encoding: 32 | - chunked 33 | Connection: 34 | - keep-alive 35 | body: 36 | encoding: UTF-8 37 | string: |- 38 | { 39 | "createdAt" : 1395183243556, 40 | "duration" : 0, 41 | "id" : "30b3ebf1-ba36-4f5b-8def-6f70d9986fe9", 42 | "name" : "", 43 | "partnerId" : 123456, 44 | "reason" : "", 45 | "sessionId" : "SESSIONID", 46 | "size" : 0, 47 | "status" : "started", 48 | "url" : null, 49 | "streamMode":"manual" 50 | } 51 | recorded_at: Tue, 18 Apr 2017 10:17:40 GMT 52 | recorded_with: VCR 6.0.0 53 | -------------------------------------------------------------------------------- /spec/cassettes/OpenTok_Archives/should_create_an_archives_with_a_specified_multiArchiveTag.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://api.opentok.com/v2/project/123456/archive 6 | body: 7 | encoding: UTF-8 8 | string: '{"sessionId":"SESSIONID","multiArchiveTag":"archive-1"}' 9 | headers: 10 | User-Agent: 11 | - OpenTok-Ruby-SDK/<%= version %> 12 | X-Opentok-Auth: 13 | - eyJpc3QiOiJwcm9qZWN0IiwiYWxnIjoiSFMyNTYifQ.eyJpc3MiOiIxMjM0NTYiLCJpYXQiOjE0OTI1MTA2NjAsImV4cCI6MTQ5MjUxMDk2MH0.BplMVhJWx4ld7KLKXqEmow6MjNPPFw9W8IHCMfeb120 14 | Content-Type: 15 | - application/json 16 | Accept-Encoding: 17 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 18 | Accept: 19 | - "*/*" 20 | response: 21 | status: 22 | code: 200 23 | message: OK 24 | headers: 25 | Server: 26 | - nginx 27 | Date: 28 | - Wed, 07 Sep 2022 14:23:34 GMT 29 | Content-Type: 30 | - application/json 31 | Transfer-Encoding: 32 | - chunked 33 | Connection: 34 | - keep-alive 35 | body: 36 | encoding: UTF-8 37 | string: |- 38 | { 39 | "createdAt" : 1395183243556, 40 | "duration" : 0, 41 | "id" : "30b3ebf1-ba36-4f5b-8def-6f70d9986fe9", 42 | "name" : "", 43 | "partnerId" : 123456, 44 | "reason" : "", 45 | "sessionId" : "SESSIONID", 46 | "size" : 0, 47 | "status" : "started", 48 | "url" : null, 49 | "multiArchiveTag":"archive-1" 50 | } 51 | recorded_at: Tue, 18 Apr 2017 10:17:40 GMT 52 | recorded_with: VCR 6.0.0 53 | -------------------------------------------------------------------------------- /spec/cassettes/OpenTok_Archives/should_create_archives.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://api.opentok.com/v2/project/123456/archive 6 | body: 7 | encoding: UTF-8 8 | string: '{"sessionId":"SESSIONID"}' 9 | headers: 10 | User-Agent: 11 | - OpenTok-Ruby-SDK/<%= version %> 12 | X-Opentok-Auth: 13 | - eyJpc3QiOiJwcm9qZWN0IiwiYWxnIjoiSFMyNTYifQ.eyJpc3MiOiIxMjM0NTYiLCJpYXQiOjE0OTI1MTA2NjAsImV4cCI6MTQ5MjUxMDk2MH0.BplMVhJWx4ld7KLKXqEmow6MjNPPFw9W8IHCMfeb120 14 | Content-Type: 15 | - application/json 16 | Accept-Encoding: "gzip;q=1.0,deflate;q=0.6,identity;q=0.3" 17 | Accept: "*/*" 18 | response: 19 | status: 20 | code: 200 21 | message: OK 22 | headers: 23 | Server: 24 | - nginx 25 | Date: 26 | - Tue, 18 Mar 2014 22:54:03 GMT 27 | Content-Type: 28 | - application/json 29 | Transfer-Encoding: 30 | - chunked 31 | Connection: 32 | - keep-alive 33 | body: 34 | encoding: UTF-8 35 | string: |- 36 | { 37 | "createdAt" : 1395183243556, 38 | "duration" : 0, 39 | "id" : "30b3ebf1-ba36-4f5b-8def-6f70d9986fe9", 40 | "name" : "", 41 | "partnerId" : 123456, 42 | "reason" : "", 43 | "sessionId" : "SESSIONID", 44 | "size" : 0, 45 | "status" : "started", 46 | "url" : null 47 | } 48 | http_version: 49 | recorded_at: Tue, 18 Mar 2014 22:54:03 GMT 50 | recorded_with: VCR 2.8.0 51 | -------------------------------------------------------------------------------- /spec/cassettes/OpenTok_Archives/should_create_audio_only_archives.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://api.opentok.com/v2/project/123456/archive 6 | body: 7 | encoding: UTF-8 8 | string: '{"sessionId":"SESSIONID","hasVideo":false}' 9 | headers: 10 | User-Agent: 11 | - OpenTok-Ruby-SDK/<%= version %> 12 | X-Opentok-Auth: 13 | - eyJpc3QiOiJwcm9qZWN0IiwiYWxnIjoiSFMyNTYifQ.eyJpc3MiOiIxMjM0NTYiLCJpYXQiOjE0OTI1MTA2NjAsImV4cCI6MTQ5MjUxMDk2MH0.BplMVhJWx4ld7KLKXqEmow6MjNPPFw9W8IHCMfeb120 14 | Content-Type: 15 | - application/json 16 | Accept-Encoding: "gzip;q=1.0,deflate;q=0.6,identity;q=0.3" 17 | Accept: "*/*" 18 | response: 19 | status: 20 | code: 200 21 | message: OK 22 | headers: 23 | Server: 24 | - nginx 25 | Date: 26 | - Wed, 19 Mar 2014 01:49:22 GMT 27 | Content-Type: 28 | - application/json 29 | Transfer-Encoding: 30 | - chunked 31 | Connection: 32 | - keep-alive 33 | body: 34 | encoding: UTF-8 35 | string: |- 36 | { 37 | "createdAt" : 1395193762293, 38 | "duration" : 0, 39 | "id" : "d7f4d2a3-da74-414d-868a-190532a835bc", 40 | "name" : "ARCHIVE NAME", 41 | "partnerId" : 123456, 42 | "reason" : "", 43 | "sessionId" : "SESSIONID", 44 | "size" : 0, 45 | "status" : "started", 46 | "url" : null, 47 | "hasAudio" : true, 48 | "hasVideo" : false 49 | } 50 | http_version: 51 | recorded_at: Wed, 19 Mar 2014 01:49:22 GMT 52 | recorded_with: VCR 2.8.0 53 | -------------------------------------------------------------------------------- /spec/cassettes/OpenTok_Archives/should_create_custom_layout_archives.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://api.opentok.com/v2/project/123456/archive 6 | body: 7 | encoding: UTF-8 8 | string: '{"sessionId":"SESSIONID","layout":{"type":"custom","stylesheet":"stream:last-child{display: block;margin: 0;top: 0;left: 0;width: 1px;height: 1px;}stream:first-child{display: block;margin: 0;top: 0;left: 0;width: 100%;height: 100%;}"}}' 9 | headers: 10 | User-Agent: 11 | - OpenTok-Ruby-SDK/<%= version %> 12 | X-Opentok-Auth: 13 | - eyJpc3QiOiJwcm9qZWN0IiwiYWxnIjoiSFMyNTYifQ.eyJpc3MiOiIxMjM0NTYiLCJpYXQiOjE0OTI1MTA2NjAsImV4cCI6MTQ5MjUxMDk2MH0.BplMVhJWx4ld7KLKXqEmow6MjNPPFw9W8IHCMfeb120 14 | Content-Type: 15 | - application/json 16 | Accept-Encoding: "gzip;q=1.0,deflate;q=0.6,identity;q=0.3" 17 | Accept: "*/*" 18 | response: 19 | status: 20 | code: 200 21 | message: OK 22 | headers: 23 | Server: 24 | - nginx 25 | Date: 26 | - Fri, 17 Jan 2020 21:15:36 GMT 27 | Content-Type: 28 | - application/json 29 | Transfer-Encoding: 30 | - chunked 31 | Connection: 32 | - keep-alive 33 | body: 34 | encoding: UTF-8 35 | string: |- 36 | { 37 | "createdAt" : 1395183243556, 38 | "duration" : 0, 39 | "id" : "30b3ebf1-ba36-4f5b-8def-6f70d9986fe9", 40 | "name" : "", 41 | "partnerId" : 123456, 42 | "reason" : "", 43 | "sessionId" : "SESSIONID", 44 | "size" : 0, 45 | "status" : "started", 46 | "url" : null 47 | } 48 | http_version: 49 | recorded_at: Fri, 17 Jan 2020 21:15:36 GMT 50 | recorded_with: VCR 5.0.0 51 | -------------------------------------------------------------------------------- /spec/cassettes/OpenTok_Archives/should_create_hd_archives.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://api.opentok.com/v2/project/123456/archive 6 | body: 7 | encoding: UTF-8 8 | string: '{"sessionId":"SESSIONID","outputMode":"composed","resolution":"1280x720"}' 9 | headers: 10 | User-Agent: 11 | - OpenTok-Ruby-SDK/<%= version %> 12 | X-Opentok-Auth: 13 | - eyJpc3QiOiJwcm9qZWN0IiwiYWxnIjoiSFMyNTYifQ.eyJpc3MiOiIxMjM0NTYiLCJpYXQiOjE0OTI1MTA2NjAsImV4cCI6MTQ5MjUxMDk2MH0.BplMVhJWx4ld7KLKXqEmow6MjNPPFw9W8IHCMfeb120 14 | Content-Type: 15 | - application/json 16 | Accept-Encoding: "gzip;q=1.0,deflate;q=0.6,identity;q=0.3" 17 | Accept: "*/*" 18 | response: 19 | status: 20 | code: 200 21 | message: OK 22 | headers: 23 | Server: 24 | - nginx 25 | Date: 26 | - Fri, 21 Sep 2018 16:54:25 GMT 27 | Content-Type: 28 | - application/json 29 | Transfer-Encoding: 30 | - chunked 31 | Connection: 32 | - keep-alive 33 | body: 34 | encoding: UTF-8 35 | string: |- 36 | { 37 | "createdAt" : 1395193762293, 38 | "duration" : 0, 39 | "id" : "d7f4d2a3-da74-414d-868a-190532a835bc", 40 | "name" : "ARCHIVE NAME", 41 | "partnerId" : 123456, 42 | "reason" : "", 43 | "sessionId" : "SESSIONID", 44 | "size" : 0, 45 | "status" : "started", 46 | "url" : null, 47 | "hasAudio" : true, 48 | "hasVideo" : false, 49 | "outputMode": "composed", 50 | "resolution": "1280x720" 51 | } 52 | http_version: 53 | recorded_at: Fri, 21 Sep 2018 16:54:25 GMT 54 | recorded_with: VCR 2.8.0 55 | -------------------------------------------------------------------------------- /spec/cassettes/OpenTok_Archives/should_create_individual_archives.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://api.opentok.com/v2/project/123456/archive 6 | body: 7 | encoding: UTF-8 8 | string: '{"sessionId":"SESSIONID","outputMode":"individual"}' 9 | headers: 10 | User-Agent: 11 | - OpenTok-Ruby-SDK/<%= version %> 12 | X-Opentok-Auth: 13 | - eyJpc3QiOiJwcm9qZWN0IiwiYWxnIjoiSFMyNTYifQ.eyJpc3MiOiIxMjM0NTYiLCJpYXQiOjE0OTI1MTA2NjAsImV4cCI6MTQ5MjUxMDk2MH0.BplMVhJWx4ld7KLKXqEmow6MjNPPFw9W8IHCMfeb120 14 | Content-Type: 15 | - application/json 16 | Accept-Encoding: "gzip;q=1.0,deflate;q=0.6,identity;q=0.3" 17 | Accept: "*/*" 18 | response: 19 | status: 20 | code: 200 21 | message: OK 22 | headers: 23 | Server: 24 | - nginx 25 | Date: 26 | - Wed, 19 Mar 2014 01:49:22 GMT 27 | Content-Type: 28 | - application/json 29 | Transfer-Encoding: 30 | - chunked 31 | Connection: 32 | - keep-alive 33 | body: 34 | encoding: UTF-8 35 | string: |- 36 | { 37 | "createdAt" : 1395193762293, 38 | "duration" : 0, 39 | "id" : "d7f4d2a3-da74-414d-868a-190532a835bc", 40 | "name" : "ARCHIVE NAME", 41 | "partnerId" : 123456, 42 | "reason" : "", 43 | "sessionId" : "SESSIONID", 44 | "size" : 0, 45 | "status" : "started", 46 | "url" : null, 47 | "hasAudio" : true, 48 | "hasVideo" : false, 49 | "outputMode": "individual" 50 | } 51 | http_version: 52 | recorded_at: Wed, 19 Mar 2014 01:49:22 GMT 53 | recorded_with: VCR 2.8.0 54 | -------------------------------------------------------------------------------- /spec/cassettes/OpenTok_Archives/should_create_layout_archives_with_screenshare_layout_types.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://api.opentok.com/v2/project/123456/archive 6 | body: 7 | encoding: UTF-8 8 | string: '{"sessionId":"SESSIONID","layout":{"type":"bestFit","screenshare_type":"verticalPresentation"}}' 9 | headers: 10 | User-Agent: 11 | - OpenTok-Ruby-SDK/<%= version %> 12 | X-Opentok-Auth: 13 | - eyJpc3QiOiJwcm9qZWN0IiwiYWxnIjoiSFMyNTYifQ.eyJpc3MiOiIxMjM0NTYiLCJpYXQiOjE0OTI1MTA2NjAsImV4cCI6MTQ5MjUxMDk2MH0.BplMVhJWx4ld7KLKXqEmow6MjNPPFw9W8IHCMfeb120 14 | Content-Type: 15 | - application/json 16 | Accept-Encoding: "gzip;q=1.0,deflate;q=0.6,identity;q=0.3" 17 | Accept: "*/*" 18 | response: 19 | status: 20 | code: 200 21 | message: OK 22 | headers: 23 | Server: 24 | - nginx 25 | Date: 26 | - Fri, 17 Jan 2020 21:15:36 GMT 27 | Content-Type: 28 | - application/json 29 | Transfer-Encoding: 30 | - chunked 31 | Connection: 32 | - keep-alive 33 | body: 34 | encoding: UTF-8 35 | string: |- 36 | { 37 | "createdAt" : 1395183243556, 38 | "duration" : 0, 39 | "id" : "30b3ebf1-ba36-4f5b-8def-6f70d9986fe9", 40 | "name" : "", 41 | "partnerId" : 123456, 42 | "reason" : "", 43 | "sessionId" : "SESSIONID", 44 | "size" : 0, 45 | "status" : "started", 46 | "url" : null 47 | } 48 | http_version: 49 | recorded_at: Tue, 26 Jan 2021 09:01:36 GMT 50 | recorded_with: VCR 5.0.0 51 | -------------------------------------------------------------------------------- /spec/cassettes/OpenTok_Archives/should_create_named_archives.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://api.opentok.com/v2/project/123456/archive 6 | body: 7 | encoding: UTF-8 8 | string: '{"sessionId":"SESSIONID","name":"ARCHIVE NAME"}' 9 | headers: 10 | User-Agent: 11 | - OpenTok-Ruby-SDK/<%= version %> 12 | X-Opentok-Auth: 13 | - eyJpc3QiOiJwcm9qZWN0IiwiYWxnIjoiSFMyNTYifQ.eyJpc3MiOiIxMjM0NTYiLCJpYXQiOjE0OTI1MTA2NjAsImV4cCI6MTQ5MjUxMDk2MH0.BplMVhJWx4ld7KLKXqEmow6MjNPPFw9W8IHCMfeb120 14 | Content-Type: 15 | - application/json 16 | Accept-Encoding: "gzip;q=1.0,deflate;q=0.6,identity;q=0.3" 17 | Accept: "*/*" 18 | response: 19 | status: 20 | code: 200 21 | message: OK 22 | headers: 23 | Server: 24 | - nginx 25 | Date: 26 | - Wed, 19 Mar 2014 01:49:22 GMT 27 | Content-Type: 28 | - application/json 29 | Transfer-Encoding: 30 | - chunked 31 | Connection: 32 | - keep-alive 33 | body: 34 | encoding: UTF-8 35 | string: |- 36 | { 37 | "createdAt" : 1395193762293, 38 | "duration" : 0, 39 | "id" : "d7f4d2a3-da74-414d-868a-190532a835bc", 40 | "name" : "ARCHIVE NAME", 41 | "partnerId" : 123456, 42 | "reason" : "", 43 | "sessionId" : "SESSIONID", 44 | "size" : 0, 45 | "status" : "started", 46 | "url" : null 47 | } 48 | http_version: 49 | recorded_at: Wed, 19 Mar 2014 01:49:22 GMT 50 | recorded_with: VCR 2.8.0 51 | -------------------------------------------------------------------------------- /spec/cassettes/OpenTok_Archives/should_delete_an_archive_by_id.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: delete 5 | uri: https://api.opentok.com/v2/project/123456/archive/832641bf-5dbf-41a1-ad94-fea213e59a92 6 | body: 7 | encoding: US-ASCII 8 | string: '' 9 | headers: 10 | User-Agent: 11 | - OpenTok-Ruby-SDK/<%= version %> 12 | X-Opentok-Auth: 13 | - eyJpc3QiOiJwcm9qZWN0IiwiYWxnIjoiSFMyNTYifQ.eyJpc3MiOiIxMjM0NTYiLCJpYXQiOjE0OTI1MTA2NjAsImV4cCI6MTQ5MjUxMDk2MH0.BplMVhJWx4ld7KLKXqEmow6MjNPPFw9W8IHCMfeb120 14 | Content-Type: 15 | - application/json 16 | Accept-Encoding: "gzip;q=1.0,deflate;q=0.6,identity;q=0.3" 17 | Accept: "*/*" 18 | response: 19 | status: 20 | code: 204 21 | message: No Content 22 | headers: 23 | Server: 24 | - nginx 25 | Date: 26 | - Wed, 19 Mar 2014 02:04:39 GMT 27 | Connection: 28 | - keep-alive 29 | body: 30 | encoding: UTF-8 31 | string: '' 32 | http_version: 33 | recorded_at: Wed, 19 Mar 2014 02:04:39 GMT 34 | recorded_with: VCR 2.8.0 35 | -------------------------------------------------------------------------------- /spec/cassettes/OpenTok_Archives/should_find_archives_by_id.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: get 5 | uri: https://api.opentok.com/v2/project/123456/archive/f6e7ee58-d6cf-4a59-896b-6d56b158ec71 6 | body: 7 | encoding: US-ASCII 8 | string: '' 9 | headers: 10 | User-Agent: 11 | - OpenTok-Ruby-SDK/<%= version %> 12 | X-Opentok-Auth: 13 | - eyJpc3QiOiJwcm9qZWN0IiwiYWxnIjoiSFMyNTYifQ.eyJpc3MiOiIxMjM0NTYiLCJpYXQiOjE0OTI1MTA2NjAsImV4cCI6MTQ5MjUxMDk2MH0.BplMVhJWx4ld7KLKXqEmow6MjNPPFw9W8IHCMfeb120 14 | Accept-Encoding: "gzip;q=1.0,deflate;q=0.6,identity;q=0.3" 15 | Accept: "*/*" 16 | response: 17 | status: 18 | code: 200 19 | message: OK 20 | headers: 21 | Server: 22 | - nginx 23 | Date: 24 | - Wed, 19 Mar 2014 01:49:22 GMT 25 | Content-Type: 26 | - application/json 27 | Transfer-Encoding: 28 | - chunked 29 | Connection: 30 | - keep-alive 31 | body: 32 | encoding: UTF-8 33 | string: |- 34 | { 35 | "createdAt" : 1395187836000, 36 | "duration" : 62, 37 | "id" : "f6e7ee58-d6cf-4a59-896b-6d56b158ec71", 38 | "name" : "", 39 | "partnerId" : 123456, 40 | "reason" : "", 41 | "sessionId" : "SESSIONID", 42 | "size" : 8347554, 43 | "status" : "available", 44 | "url" : "http://tokbox.com.archive2.s3.amazonaws.com/123456%2Ff6e7ee58-d6cf-4a59-896b-6d56b158ec71%2Farchive.mp4?Expires=1395194362&AWSAccessKeyId=AKIAI6LQCPIXYVWCQV6Q&Signature=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", 45 | "notarealproperty" : "not a real value" 46 | } 47 | http_version: 48 | recorded_at: Wed, 19 Mar 2014 01:49:22 GMT 49 | recorded_with: VCR 2.8.0 50 | -------------------------------------------------------------------------------- /spec/cassettes/OpenTok_Archives/should_find_archives_with_unknown_properties.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: get 5 | uri: https://api.opentok.com/v2/project/123456/archive/f6e7ee58-d6cf-4a59-896b-6d56b158ec71 6 | body: 7 | encoding: US-ASCII 8 | string: '' 9 | headers: 10 | User-Agent: 11 | - OpenTok-Ruby-SDK/<%= version %> 12 | X-Opentok-Auth: 13 | - eyJpc3QiOiJwcm9qZWN0IiwiYWxnIjoiSFMyNTYifQ.eyJpc3MiOiIxMjM0NTYiLCJpYXQiOjE0OTI1MTA2NjAsImV4cCI6MTQ5MjUxMDk2MH0.BplMVhJWx4ld7KLKXqEmow6MjNPPFw9W8IHCMfeb120 14 | Accept-Encoding: "gzip;q=1.0,deflate;q=0.6,identity;q=0.3" 15 | Accept: "*/*" 16 | response: 17 | status: 18 | code: 200 19 | message: OK 20 | headers: 21 | Server: 22 | - nginx 23 | Date: 24 | - Wed, 19 Mar 2014 01:49:22 GMT 25 | Content-Type: 26 | - application/json 27 | Transfer-Encoding: 28 | - chunked 29 | Connection: 30 | - keep-alive 31 | body: 32 | encoding: UTF-8 33 | string: |- 34 | { 35 | "createdAt" : 1395187836000, 36 | "duration" : 62, 37 | "id" : "f6e7ee58-d6cf-4a59-896b-6d56b158ec71", 38 | "name" : "", 39 | "partnerId" : 123456, 40 | "reason" : "", 41 | "sessionId" : "SESSIONID", 42 | "size" : 8347554, 43 | "status" : "available", 44 | "url" : "http://tokbox.com.archive2.s3.amazonaws.com/123456%2Ff6e7ee58-d6cf-4a59-896b-6d56b158ec71%2Farchive.mp4?Expires=1395194362&AWSAccessKeyId=AKIAI6LQCPIXYVWCQV6Q&Signature=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" 45 | } 46 | http_version: 47 | recorded_at: Wed, 19 Mar 2014 01:49:22 GMT 48 | recorded_with: VCR 2.8.0 49 | -------------------------------------------------------------------------------- /spec/cassettes/OpenTok_Archives/should_find_expired_archives.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: get 5 | uri: https://api.opentok.com/v2/project/123456/archive/f6e7ee58-d6cf-4a59-896b-6d56b158ec71 6 | body: 7 | encoding: US-ASCII 8 | string: '' 9 | headers: 10 | User-Agent: 11 | - OpenTok-Ruby-SDK/<%= version %> 12 | X-Opentok-Auth: 13 | - eyJpc3QiOiJwcm9qZWN0IiwiYWxnIjoiSFMyNTYifQ.eyJpc3MiOiIxMjM0NTYiLCJpYXQiOjE0OTI1MTA2NjAsImV4cCI6MTQ5MjUxMDk2MH0.BplMVhJWx4ld7KLKXqEmow6MjNPPFw9W8IHCMfeb120 14 | Accept-Encoding: "gzip;q=1.0,deflate;q=0.6,identity;q=0.3" 15 | Accept: "*/*" 16 | response: 17 | status: 18 | code: 200 19 | message: OK 20 | headers: 21 | Server: 22 | - nginx 23 | Date: 24 | - Wed, 19 Mar 2014 01:49:22 GMT 25 | Content-Type: 26 | - application/json 27 | Transfer-Encoding: 28 | - chunked 29 | Connection: 30 | - keep-alive 31 | body: 32 | encoding: UTF-8 33 | string: |- 34 | { 35 | "createdAt" : 1395187836000, 36 | "duration" : 62, 37 | "id" : "f6e7ee58-d6cf-4a59-896b-6d56b158ec71", 38 | "name" : "", 39 | "partnerId" : 123456, 40 | "reason" : "", 41 | "sessionId" : "SESSIONID", 42 | "size" : 8347554, 43 | "status" : "expired", 44 | "url" : null 45 | } 46 | http_version: 47 | recorded_at: Wed, 19 Mar 2014 01:49:22 GMT 48 | recorded_with: VCR 2.8.0 49 | -------------------------------------------------------------------------------- /spec/cassettes/OpenTok_Archives/should_find_paused_archives_by_id.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: get 5 | uri: https://api.opentok.com/v2/project/123456/archive/f6e7ee58-d6cf-4a59-896b-6d56b158ec71 6 | body: 7 | encoding: US-ASCII 8 | string: '' 9 | headers: 10 | User-Agent: 11 | - OpenTok-Ruby-SDK/<%= version %> 12 | X-Opentok-Auth: 13 | - eyJpc3QiOiJwcm9qZWN0IiwiYWxnIjoiSFMyNTYifQ.eyJpc3MiOiIxMjM0NTYiLCJpYXQiOjE0OTI1MTA2NjAsImV4cCI6MTQ5MjUxMDk2MH0.BplMVhJWx4ld7KLKXqEmow6MjNPPFw9W8IHCMfeb120 14 | Accept-Encoding: "gzip;q=1.0,deflate;q=0.6,identity;q=0.3" 15 | Accept: "*/*" 16 | response: 17 | status: 18 | code: 200 19 | message: OK 20 | headers: 21 | Server: 22 | - nginx 23 | Date: 24 | - Wed, 19 Mar 2014 01:49:22 GMT 25 | Content-Type: 26 | - application/json 27 | Transfer-Encoding: 28 | - chunked 29 | Connection: 30 | - keep-alive 31 | body: 32 | encoding: UTF-8 33 | string: |- 34 | { 35 | "createdAt" : 1395187836000, 36 | "duration" : 62, 37 | "id" : "f6e7ee58-d6cf-4a59-896b-6d56b158ec71", 38 | "name" : "", 39 | "partnerId" : 123456, 40 | "reason" : "", 41 | "sessionId" : "SESSIONID", 42 | "size" : 8347554, 43 | "status" : "paused", 44 | "url" : null 45 | } 46 | http_version: 47 | recorded_at: Wed, 19 Mar 2014 01:49:22 GMT 48 | recorded_with: VCR 2.8.0 49 | -------------------------------------------------------------------------------- /spec/cassettes/OpenTok_Archives/should_stop_archives.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://api.opentok.com/v2/project/123456/archive/30b3ebf1-ba36-4f5b-8def-6f70d9986fe9/stop 6 | headers: 7 | User-Agent: 8 | - OpenTok-Ruby-SDK/<%= version %> 9 | X-Opentok-Auth: 10 | - eyJpc3QiOiJwcm9qZWN0IiwiYWxnIjoiSFMyNTYifQ.eyJpc3MiOiIxMjM0NTYiLCJpYXQiOjE0OTI1MTA2NjAsImV4cCI6MTQ5MjUxMDk2MH0.BplMVhJWx4ld7KLKXqEmow6MjNPPFw9W8IHCMfeb120 11 | Content-Type: 12 | - application/json 13 | Accept-Encoding: "gzip;q=1.0,deflate;q=0.6,identity;q=0.3" 14 | Accept: "*/*" 15 | response: 16 | status: 17 | code: 200 18 | message: OK 19 | headers: 20 | Server: 21 | - nginx 22 | Date: 23 | - Tue, 18 Mar 2014 23:03:08 GMT 24 | Content-Type: 25 | - application/json 26 | Transfer-Encoding: 27 | - chunked 28 | Connection: 29 | - keep-alive 30 | body: 31 | encoding: UTF-8 32 | string: |- 33 | { 34 | "createdAt" : 1395183243000, 35 | "duration" : 0, 36 | "id" : "30b3ebf1-ba36-4f5b-8def-6f70d9986fe9", 37 | "name" : "", 38 | "partnerId" : 123456, 39 | "reason" : "", 40 | "sessionId" : "SESSIONID", 41 | "size" : 0, 42 | "status" : "stopped", 43 | "url" : null 44 | } 45 | http_version: 46 | recorded_at: Tue, 18 Mar 2014 23:03:07 GMT 47 | recorded_with: VCR 2.8.0 48 | -------------------------------------------------------------------------------- /spec/cassettes/OpenTok_Archives/when_many_archives_are_created/should_return_archives_with_an_offset.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: get 5 | uri: https://api.opentok.com/v2/project/123456/archive?offset=3 6 | body: 7 | encoding: US-ASCII 8 | string: '' 9 | headers: 10 | User-Agent: 11 | - OpenTok-Ruby-SDK/<%= version %> 12 | X-Opentok-Auth: 13 | - eyJpc3QiOiJwcm9qZWN0IiwiYWxnIjoiSFMyNTYifQ.eyJpc3MiOiIxMjM0NTYiLCJpYXQiOjE0OTI1MTA2NjAsImV4cCI6MTQ5MjUxMDk2MH0.BplMVhJWx4ld7KLKXqEmow6MjNPPFw9W8IHCMfeb120 14 | Accept-Encoding: "gzip;q=1.0,deflate;q=0.6,identity;q=0.3" 15 | Accept: "*/*" 16 | response: 17 | status: 18 | code: 200 19 | message: OK 20 | headers: 21 | Server: 22 | - nginx 23 | Date: 24 | - Wed, 19 Mar 2014 00:44:22 GMT 25 | Content-Type: 26 | - application/json 27 | Transfer-Encoding: 28 | - chunked 29 | Connection: 30 | - keep-alive 31 | body: 32 | encoding: UTF-8 33 | string: |- 34 | { 35 | "count" : 3, 36 | "items" : [ { 37 | "createdAt" : 1395183243000, 38 | "duration" : 544, 39 | "id" : "30b3ebf1-ba36-4f5b-8def-6f70d9986fe9", 40 | "name" : "", 41 | "partnerId" : 123456, 42 | "reason" : "", 43 | "sessionId" : "SESSIONID", 44 | "size" : 78499758, 45 | "status" : "available", 46 | "url" : "http://tokbox.com.archive2.s3.amazonaws.com/123456%2F30b3ebf1-ba36-4f5b-8def-6f70d9986fe9%2Farchive.mp4?Expires=1395188695&AWSAccessKeyId=AKIAI6LQCPIXYVWCQV6Q&Signature=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" 47 | }, { 48 | "createdAt" : 1394396753000, 49 | "duration" : 24, 50 | "id" : "b8f64de1-e218-4091-9544-4cbf369fc238", 51 | "name" : "showtime again", 52 | "partnerId" : 123456, 53 | "reason" : "", 54 | "sessionId" : "SESSIONID", 55 | "size" : 2227849, 56 | "status" : "available", 57 | "url" : "http://tokbox.com.archive2.s3.amazonaws.com/123456%2Fb8f64de1-e218-4091-9544-4cbf369fc238%2Farchive.mp4?Expires=1395188695&AWSAccessKeyId=AKIAI6LQCPIXYVWCQV6Q&Signature=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" 58 | }, { 59 | "createdAt" : 1394321113000, 60 | "duration" : 1294, 61 | "id" : "832641bf-5dbf-41a1-ad94-fea213e59a92", 62 | "name" : "showtime", 63 | "partnerId" : 123456, 64 | "reason" : "", 65 | "sessionId" : "SESSIONID", 66 | "size" : 42165242, 67 | "status" : "available", 68 | "url" : "http://tokbox.com.archive2.s3.amazonaws.com/123456%2F832641bf-5dbf-41a1-ad94-fea213e59a92%2Farchive.mp4?Expires=1395188695&AWSAccessKeyId=AKIAI6LQCPIXYVWCQV6Q&Signature=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" 69 | } ] 70 | } 71 | http_version: 72 | recorded_at: Wed, 19 Mar 2014 00:44:22 GMT 73 | recorded_with: VCR 2.8.0 74 | -------------------------------------------------------------------------------- /spec/cassettes/OpenTok_Archives/when_many_archives_are_created/should_return_count_number_of_archives.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: get 5 | uri: https://api.opentok.com/v2/project/123456/archive?count=2 6 | body: 7 | encoding: US-ASCII 8 | string: '' 9 | headers: 10 | User-Agent: 11 | - OpenTok-Ruby-SDK/<%= version %> 12 | X-Opentok-Auth: 13 | - eyJpc3QiOiJwcm9qZWN0IiwiYWxnIjoiSFMyNTYifQ.eyJpc3MiOiIxMjM0NTYiLCJpYXQiOjE0OTI1MTA2NjAsImV4cCI6MTQ5MjUxMDk2MH0.BplMVhJWx4ld7KLKXqEmow6MjNPPFw9W8IHCMfeb120 14 | Accept-Encoding: "gzip;q=1.0,deflate;q=0.6,identity;q=0.3" 15 | Accept: "*/*" 16 | response: 17 | status: 18 | code: 200 19 | message: OK 20 | headers: 21 | Server: 22 | - nginx 23 | Date: 24 | - Wed, 19 Mar 2014 00:54:18 GMT 25 | Content-Type: 26 | - application/json 27 | Transfer-Encoding: 28 | - chunked 29 | Connection: 30 | - keep-alive 31 | body: 32 | encoding: UTF-8 33 | string: |- 34 | { 35 | "count" : 2, 36 | "items" : [ { 37 | "createdAt" : 1395187930000, 38 | "duration" : 22, 39 | "id" : "ef546c5a-4fd7-4e59-ab3d-f1cfb4148d1d", 40 | "name" : "", 41 | "partnerId" : 123456, 42 | "reason" : "", 43 | "sessionId" : "SESSIONID", 44 | "size" : 2909274, 45 | "status" : "available", 46 | "url" : "http://tokbox.com.archive2.s3.amazonaws.com/123456%2Fef546c5a-4fd7-4e59-ab3d-f1cfb4148d1d%2Farchive.mp4?Expires=1395188695&AWSAccessKeyId=AKIAI6LQCPIXYVWCQV6Q&Signature=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" 47 | }, { 48 | "createdAt" : 1395187910000, 49 | "duration" : 14, 50 | "id" : "5350f06f-0166-402e-bc27-09ba54948512", 51 | "name" : "", 52 | "partnerId" : 123456, 53 | "reason" : "", 54 | "sessionId" : "SESSIONID", 55 | "size" : 1952651, 56 | "status" : "available", 57 | "url" : "http://tokbox.com.archive2.s3.amazonaws.com/123456%2F5350f06f-0166-402e-bc27-09ba54948512%2Farchive.mp4?Expires=1395188695&AWSAccessKeyId=AKIAI6LQCPIXYVWCQV6Q&Signature=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" 58 | } ] 59 | } 60 | http_version: 61 | recorded_at: Wed, 19 Mar 2014 00:54:18 GMT 62 | recorded_with: VCR 2.8.0 63 | -------------------------------------------------------------------------------- /spec/cassettes/OpenTok_Archives/when_many_archives_are_created/should_return_part_of_the_archives_when_using_offset_and_count.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: get 5 | uri: https://api.opentok.com/v2/project/123456/archive?count=4&offset=2 6 | body: 7 | encoding: US-ASCII 8 | string: '' 9 | headers: 10 | User-Agent: 11 | - OpenTok-Ruby-SDK/<%= version %> 12 | X-Opentok-Auth: 13 | - eyJpc3QiOiJwcm9qZWN0IiwiYWxnIjoiSFMyNTYifQ.eyJpc3MiOiIxMjM0NTYiLCJpYXQiOjE0OTI1MTA2NjAsImV4cCI6MTQ5MjUxMDk2MH0.BplMVhJWx4ld7KLKXqEmow6MjNPPFw9W8IHCMfeb120 14 | Accept-Encoding: "gzip;q=1.0,deflate;q=0.6,identity;q=0.3" 15 | Accept: "*/*" 16 | response: 17 | status: 18 | code: 200 19 | message: OK 20 | headers: 21 | Server: 22 | - nginx 23 | Date: 24 | - Wed, 19 Mar 2014 00:57:50 GMT 25 | Content-Type: 26 | - application/json 27 | Transfer-Encoding: 28 | - chunked 29 | Connection: 30 | - keep-alive 31 | body: 32 | encoding: UTF-8 33 | string: |- 34 | { 35 | "count" : 4, 36 | "items" : [ { 37 | "createdAt" : 1395187836000, 38 | "duration" : 62, 39 | "id" : "f6e7ee58-d6cf-4a59-896b-6d56b158ec71", 40 | "name" : "", 41 | "partnerId" : 123456, 42 | "reason" : "", 43 | "sessionId" : "SESSIONID", 44 | "size" : 8347554, 45 | "status" : "available", 46 | "url" : "http://tokbox.com.archive2.s3.amazonaws.com/123456%2Ff6e7ee58-d6cf-4a59-896b-6d56b158ec71%2Farchive.mp4?Expires=1395188695&AWSAccessKeyId=AKIAI6LQCPIXYVWCQV6Q&Signature=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" 47 | }, { 48 | "createdAt" : 1395183243000, 49 | "duration" : 544, 50 | "id" : "30b3ebf1-ba36-4f5b-8def-6f70d9986fe9", 51 | "name" : "", 52 | "partnerId" : 123456, 53 | "reason" : "", 54 | "sessionId" : "SESSIONID", 55 | "size" : 78499758, 56 | "status" : "available", 57 | "url" : "http://tokbox.com.archive2.s3.amazonaws.com/123456%2F30b3ebf1-ba36-4f5b-8def-6f70d9986fe9%2Farchive.mp4?Expires=1395188695&AWSAccessKeyId=AKIAI6LQCPIXYVWCQV6Q&Signature=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" 58 | }, { 59 | "createdAt" : 1394396753000, 60 | "duration" : 24, 61 | "id" : "b8f64de1-e218-4091-9544-4cbf369fc238", 62 | "name" : "showtime again", 63 | "partnerId" : 123456, 64 | "reason" : "", 65 | "sessionId" : "SESSIONID", 66 | "size" : 2227849, 67 | "status" : "available", 68 | "url" : "http://tokbox.com.archive2.s3.amazonaws.com/123456%2Fb8f64de1-e218-4091-9544-4cbf369fc238%2Farchive.mp4?Expires=1395188695&AWSAccessKeyId=AKIAI6LQCPIXYVWCQV6Q&Signature=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" 69 | }, { 70 | "createdAt" : 1394321113000, 71 | "duration" : 1294, 72 | "id" : "832641bf-5dbf-41a1-ad94-fea213e59a92", 73 | "name" : "showtime", 74 | "partnerId" : 123456, 75 | "reason" : "", 76 | "sessionId" : "SESSIONID", 77 | "size" : 42165242, 78 | "status" : "available", 79 | "url" : "http://tokbox.com.archive2.s3.amazonaws.com/123456%2F832641bf-5dbf-41a1-ad94-fea213e59a92%2Farchive.mp4?Expires=1395188695&AWSAccessKeyId=AKIAI6LQCPIXYVWCQV6Q&Signature=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" 80 | } ] 81 | } 82 | http_version: 83 | recorded_at: Wed, 19 Mar 2014 00:57:50 GMT 84 | recorded_with: VCR 2.8.0 85 | -------------------------------------------------------------------------------- /spec/cassettes/OpenTok_Archives/when_many_archives_are_created/should_return_session_archives.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: get 5 | uri: https://api.opentok.com/v2/project/123456/archive?sessionId=SESSIONID 6 | body: 7 | encoding: US-ASCII 8 | string: '' 9 | headers: 10 | User-Agent: 11 | - OpenTok-Ruby-SDK/<%= version %> 12 | X-Opentok-Auth: 13 | - eyJpc3QiOiJwcm9qZWN0IiwiYWxnIjoiSFMyNTYifQ.eyJpc3MiOiIxMjM0NTYiLCJpYXQiOjE0OTI1MTA2NjAsImV4cCI6MTQ5MjUxMDk2MH0.BplMVhJWx4ld7KLKXqEmow6MjNPPFw9W8IHCMfeb120 14 | Accept-Encoding: "gzip;q=1.0,deflate;q=0.6,identity;q=0.3" 15 | Accept: "*/*" 16 | response: 17 | status: 18 | code: 200 19 | message: OK 20 | headers: 21 | Server: 22 | - nginx 23 | Date: 24 | - Wed, 19 Mar 2017 00:44:22 GMT 25 | Content-Type: 26 | - application/json 27 | Transfer-Encoding: 28 | - chunked 29 | Connection: 30 | - keep-alive 31 | body: 32 | encoding: UTF-8 33 | string: |- 34 | { 35 | "count" : 3, 36 | "items" : [ { 37 | "createdAt" : 1395183243000, 38 | "duration" : 544, 39 | "id" : "30b3ebf1-ba36-4f5b-8def-6f70d9986fe9", 40 | "name" : "", 41 | "partnerId" : 123456, 42 | "reason" : "", 43 | "sessionId" : "SESSIONID", 44 | "size" : 78499758, 45 | "status" : "available", 46 | "url" : "http://tokbox.com.archive2.s3.amazonaws.com/123456%2F30b3ebf1-ba36-4f5b-8def-6f70d9986fe9%2Farchive.mp4?Expires=1395188695&AWSAccessKeyId=AKIAI6LQCPIXYVWCQV6Q&Signature=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" 47 | }, { 48 | "createdAt" : 1394396753000, 49 | "duration" : 24, 50 | "id" : "b8f64de1-e218-4091-9544-4cbf369fc238", 51 | "name" : "showtime again", 52 | "partnerId" : 123456, 53 | "reason" : "", 54 | "sessionId" : "SESSIONID", 55 | "size" : 2227849, 56 | "status" : "available", 57 | "url" : "http://tokbox.com.archive2.s3.amazonaws.com/123456%2Fb8f64de1-e218-4091-9544-4cbf369fc238%2Farchive.mp4?Expires=1395188695&AWSAccessKeyId=AKIAI6LQCPIXYVWCQV6Q&Signature=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" 58 | }, { 59 | "createdAt" : 1394321113000, 60 | "duration" : 1294, 61 | "id" : "832641bf-5dbf-41a1-ad94-fea213e59a92", 62 | "name" : "showtime", 63 | "partnerId" : 123456, 64 | "reason" : "", 65 | "sessionId" : "SESSIONID", 66 | "size" : 42165242, 67 | "status" : "available", 68 | "url" : "http://tokbox.com.archive2.s3.amazonaws.com/123456%2F832641bf-5dbf-41a1-ad94-fea213e59a92%2Farchive.mp4?Expires=1395188695&AWSAccessKeyId=AKIAI6LQCPIXYVWCQV6Q&Signature=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" 69 | } ] 70 | } 71 | http_version: 72 | recorded_at: Wed, 19 Mar 2017 00:44:22 GMT 73 | recorded_with: VCR 2.8.0 74 | -------------------------------------------------------------------------------- /spec/cassettes/OpenTok_Broadcasts/adds_a_stream_to_a_broadcast.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: patch 5 | uri: https://api.opentok.com/v2/project/123456/broadcast/13dbcc23-af92-4862-9184-74b21815a814/streams 6 | body: 7 | encoding: UTF-8 8 | string: '{"addStream":"12312312-3811-4726-b508-e41a0f96c68f"}' 9 | headers: 10 | User-Agent: 11 | - OpenTok-Ruby-SDK/<%= version %> 12 | X-Opentok-Auth: 13 | - eyJpc3QiOiJwcm9qZWN0IiwiYWxnIjoiSFMyNTYifQ.eyJpc3MiOiIxMjM0NTYiLCJpYXQiOjE0OTI1MTA2NjAsImV4cCI6MTQ5MjUxMDk2MH0.BplMVhJWx4ld7KLKXqEmow6MjNPPFw9W8IHCMfeb120 14 | Content-Type: 15 | - application/json 16 | Accept-Encoding: 17 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 18 | Accept: 19 | - "*/*" 20 | response: 21 | status: 22 | code: 204 23 | message: No Content 24 | headers: 25 | Server: 26 | - nginx 27 | Date: 28 | - Tue, 23 Nov 2021 20:44:18 GMT 29 | Connection: 30 | - keep-alive 31 | Set-Cookie: 32 | - AWSALBTG=Nj5lPQS/JnLA1JkA1AcUDSrn5vUxVtJ5srP+UHP/scSFLccYUClejVswu+NTMqGisdJi/7X/qdPMWBEq6ReBXCALUGz+NKunxs/WrIBFxBOz6EYgWkHXh8DY9Rtx2xEQmDzdCDqXIgr1aUzTv8J3taybWQm4yBpzHjFJFoUjpNYxS6+1zlI=; 33 | Expires=Tue, 30 Nov 2021 20:44:18 GMT; Path=/ 34 | - AWSALBTGCORS=Nj5lPQS/JnLA1JkA1AcUDSrn5vUxVtJ5srP+UHP/scSFLccYUClejVswu+NTMqGisdJi/7X/qdPMWBEq6ReBXCALUGz+NKunxs/WrIBFxBOz6EYgWkHXh8DY9Rtx2xEQmDzdCDqXIgr1aUzTv8J3taybWQm4yBpzHjFJFoUjpNYxS6+1zlI=; 35 | Expires=Tue, 30 Nov 2021 20:44:18 GMT; Path=/; SameSite=None; Secure 36 | recorded_at: Tue, 18 Apr 2017 10:17:40 GMT 37 | recorded_with: VCR 6.0.0 38 | -------------------------------------------------------------------------------- /spec/cassettes/OpenTok_Broadcasts/calls_layout_on_broadcast_object.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: get 5 | uri: https://api.opentok.com/v2/project/123456/broadcast/13dbcc23-af92-4862-9184-74b21815a814 6 | body: 7 | encoding: US-ASCII 8 | string: '' 9 | headers: 10 | User-Agent: 11 | - OpenTok-Ruby-SDK/<%= version %> 12 | X-Opentok-Auth: 13 | - eyJpc3QiOiJwcm9qZWN0IiwiYWxnIjoiSFMyNTYifQ.eyJpc3MiOiIxMjM0NTYiLCJpYXQiOjE0OTI1MTA2NjAsImV4cCI6MTQ5MjUxMDk2MH0.BplMVhJWx4ld7KLKXqEmow6MjNPPFw9W8IHCMfeb120 14 | Accept-Encoding: "gzip;q=1.0,deflate;q=0.6,identity;q=0.3" 15 | Accept: "*/*" 16 | response: 17 | status: 18 | code: 200 19 | message: OK 20 | headers: 21 | Server: 22 | - nginx 23 | Date: 24 | - Fri, 28 Sep 2018 20:45:36 GMT 25 | Content-Type: 26 | - application/json 27 | Connection: 28 | - keep-alive 29 | body: 30 | encoding: UTF-8 31 | string: |- 32 | { 33 | "id":"13dbcc23-af92-4862-9184-74b21815a814", 34 | "sessionId":"SESSIONID", 35 | "projectId":123456, 36 | "createdAt":1538160235541, 37 | "broadcastUrls":{ 38 | "rtmp":[ 39 | { 40 | "status":"live", 41 | "id":"rubyTestStream", 42 | "serverUrl":"rtmp://x.rtmp.youtube.com/live2", 43 | "streamName":"66c9-jwuh-pquf-9x18" 44 | } 45 | ], 46 | "hls":"https://cdn-broadcast001-pdx.tokbox.com/14935/14935_77e4e8e8-0c8b-4cea-b579-0560875f7123.smil/playlist.m3u8" 47 | }, 48 | "updatedAt":1538160235541, 49 | "status":"started", 50 | "maxDuration":7200, 51 | "resolution":"640x480", 52 | "partnerId":123456, 53 | "event":"broadcast" 54 | } 55 | http_version: 56 | recorded_at: Tue, 18 Apr 2017 10:17:40 GMT 57 | recorded_with: VCR 2.8.0 58 | -------------------------------------------------------------------------------- /spec/cassettes/OpenTok_Broadcasts/changes_the_layout_of_a_broadcast.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: put 5 | uri: https://api.opentok.com/v2/project/123456/broadcast/13dbcc23-af92-4862-9184-74b21815a814/layout 6 | body: 7 | encoding: UTF-8 8 | string: '{"type":"verticalPresentation"}' 9 | headers: 10 | User-Agent: 11 | - OpenTok-Ruby-SDK/<%= version %> 12 | X-Opentok-Auth: 13 | - eyJpc3QiOiJwcm9qZWN0IiwiYWxnIjoiSFMyNTYifQ.eyJpc3MiOiIxMjM0NTYiLCJpYXQiOjE0OTI1MTA2NjAsImV4cCI6MTQ5MjUxMDk2MH0.BplMVhJWx4ld7KLKXqEmow6MjNPPFw9W8IHCMfeb120 14 | Content-Type: 15 | - application/json 16 | Accept-Encoding: "gzip;q=1.0,deflate;q=0.6,identity;q=0.3" 17 | Accept: "*/*" 18 | response: 19 | status: 20 | code: 200 21 | message: OK 22 | headers: 23 | Server: 24 | - nginx 25 | Date: 26 | - Fri, 28 Sep 2018 20:40:56 GMT 27 | Content-Type: 28 | - application/json 29 | Connection: 30 | - keep-alive 31 | Content-Length: 32 | - '73' 33 | body: 34 | encoding: UTF-8 35 | string: '{"code":-1,"message":"Issuer not found","description":"Issuer not found"}' 36 | http_version: 37 | recorded_at: Tue, 18 Apr 2017 10:17:40 GMT 38 | recorded_with: VCR 2.8.0 39 | -------------------------------------------------------------------------------- /spec/cassettes/OpenTok_Broadcasts/fetches_a_hls_broadcast_url.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://api.opentok.com/v2/project/123456/broadcast 6 | body: 7 | encoding: UTF-8 8 | string: '{"sessionId":"SESSIONID","outputs":{"hls":{}}}' 9 | headers: 10 | User-Agent: 11 | - OpenTok-Ruby-SDK/<%= version %> 12 | X-Opentok-Auth: 13 | - eyJpc3QiOiJwcm9qZWN0IiwiYWxnIjoiSFMyNTYifQ.eyJpc3MiOiIxMjM0NTYiLCJpYXQiOjE0OTI1MTA2NjAsImV4cCI6MTQ5MjUxMDk2MH0.BplMVhJWx4ld7KLKXqEmow6MjNPPFw9W8IHCMfeb120 14 | Content-Type: 15 | - application/json 16 | Accept-Encoding: "gzip;q=1.0,deflate;q=0.6,identity;q=0.3" 17 | Accept: "*/*" 18 | response: 19 | status: 20 | code: 200 21 | message: OK 22 | headers: 23 | Server: 24 | - nginx 25 | Date: 26 | - Thu, 27 Sep 2018 22:34:34 GMT 27 | Content-Type: 28 | - application/json 29 | Connection: 30 | - keep-alive 31 | body: 32 | encoding: UTF-8 33 | string: |- 34 | { 35 | "id":"BROADCASTID", 36 | "sessionId":"SESSIONID", 37 | "projectId":123456, 38 | "createdAt":1538086900154, 39 | "broadcastUrls": 40 | { 41 | "hls":"https://cdn-broadcast001-pdx.tokbox.com/14787/14787_b930bf08-1c9f-4c55-ab04-7d192578c057.smil/playlist.m3u8" 42 | }, 43 | "updatedAt":1538086900489, 44 | "status":"started", 45 | "maxDuration":7200, 46 | "resolution":"640x480", 47 | "partnerId":100, 48 | "event":"broadcast" 49 | } 50 | http_version: 51 | recorded_at: Tue, 18 Apr 2017 10:17:40 GMT 52 | recorded_with: VCR 2.8.0 53 | -------------------------------------------------------------------------------- /spec/cassettes/OpenTok_Broadcasts/finds_a_broadcast.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: get 5 | uri: https://api.opentok.com/v2/project/123456/broadcast/13dbcc23-af92-4862-9184-74b21815a814 6 | body: 7 | encoding: US-ASCII 8 | string: '' 9 | headers: 10 | User-Agent: 11 | - OpenTok-Ruby-SDK/<%= version %> 12 | X-Opentok-Auth: 13 | - eyJpc3QiOiJwcm9qZWN0IiwiYWxnIjoiSFMyNTYifQ.eyJpc3MiOiIxMjM0NTYiLCJpYXQiOjE0OTI1MTA2NjAsImV4cCI6MTQ5MjUxMDk2MH0.BplMVhJWx4ld7KLKXqEmow6MjNPPFw9W8IHCMfeb120 14 | Accept-Encoding: "gzip;q=1.0,deflate;q=0.6,identity;q=0.3" 15 | Accept: "*/*" 16 | response: 17 | status: 18 | code: 200 19 | message: OK 20 | headers: 21 | Server: 22 | - nginx 23 | Date: 24 | - Fri, 28 Sep 2018 18:46:21 GMT 25 | Content-Type: 26 | - application/json 27 | Connection: 28 | - keep-alive 29 | body: 30 | encoding: UTF-8 31 | string: |- 32 | { 33 | "id":"13dbcc23-af92-4862-9184-74b21815a814", 34 | "sessionId":"SESSIONID", 35 | "projectId":123456, 36 | "createdAt":1538160235541, 37 | "broadcastUrls":{ 38 | "rtmp":[ 39 | { 40 | "status":"live", 41 | "id":"rubyTestStream", 42 | "serverUrl":"rtmp://x.rtmp.youtube.com/live2", 43 | "streamName":"66c9-jwuh-pquf-9x18" 44 | } 45 | ], 46 | "hls":"https://cdn-broadcast001-pdx.tokbox.com/14935/14935_77e4e8e8-0c8b-4cea-b579-0560875f7123.smil/playlist.m3u8" 47 | }, 48 | "updatedAt":1538160235541, 49 | "status":"started", 50 | "maxDuration":7200, 51 | "resolution":"640x480", 52 | "partnerId":123456, 53 | "event":"broadcast" 54 | } 55 | http_version: 56 | recorded_at: Tue, 18 Apr 2017 10:17:40 GMT 57 | recorded_with: VCR 2.8.0 58 | -------------------------------------------------------------------------------- /spec/cassettes/OpenTok_Broadcasts/for_many_broadcasts/should_return_broadcasts_with_an_offset.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: get 5 | uri: https://api.opentok.com/v2/project/123456/broadcast?offset=3 6 | body: 7 | encoding: US-ASCII 8 | string: '' 9 | headers: 10 | User-Agent: 11 | - OpenTok-Ruby-SDK/<%= version %> 12 | X-Opentok-Auth: 13 | - eyJpc3QiOiJwcm9qZWN0IiwiYWxnIjoiSFMyNTYifQ.eyJpc3MiOiIxMjM0NTYiLCJpYXQiOjE0OTI1MTA2NjAsImV4cCI6MTQ5MjUxMDk2MH0.BplMVhJWx4ld7KLKXqEmow6MjNPPFw9W8IHCMfeb120 14 | Accept-Encoding: 15 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 16 | Accept: 17 | - "*/*" 18 | response: 19 | status: 20 | code: 200 21 | message: OK 22 | headers: 23 | Server: 24 | - nginx 25 | Date: 26 | - Fri, 21 Jan 2022 12:05:21 GMT 27 | Content-Type: 28 | - application/json 29 | Transfer-Encoding: 30 | - chunked 31 | Connection: 32 | - keep-alive 33 | body: 34 | encoding: UTF-8 35 | string: |- 36 | { 37 | "count" : 3, 38 | "items" : [ { 39 | "id" : "30b3ebf1-ba36-4f5b-8def-6f70d9986fe9", 40 | "sessionId" : "SESSIONID", 41 | "projectId": 123456, 42 | "createdAt" : 1395183243000, 43 | "updatedAt": 1395183243000, 44 | "resolution": "640x480", 45 | "broadcastUrls": { 46 | "hls" : "http://tokbox.com.broadcast2.s3.amazonaws.com/123456%2F30b3ebf1-ba36-4f5b-8def-6f70d9986fe9.m3u8", 47 | "rtmp": { 48 | "foo": { 49 | "serverUrl": "rtmps://myfooserver/myfooapp", 50 | "streamName": "myfoostream4", 51 | "status": "started" 52 | }, 53 | "bar": { 54 | "serverUrl": "rtmp://mybarserver/mybarapp", 55 | "streamName": "mybarstream4", 56 | "status": "live" 57 | } 58 | } 59 | }, 60 | "status": "started", 61 | "streamMode" : "manual", 62 | "streams" : [] 63 | }, { 64 | "id" : "b8f64de1-e218-4091-9544-4cbf369fc238", 65 | "sessionId" : "SESSIONID", 66 | "projectId": 123456, 67 | "createdAt" : 1394396753000, 68 | "updatedAt": 1394396753000, 69 | "resolution": "640x480", 70 | "broadcastUrls": { 71 | "hls" : "http://tokbox.com.broadcast2.s3.amazonaws.com/123456%2Fb8f64de1-e218-4091-9544-4cbf369fc238.m3u8", 72 | "rtmp": { 73 | "foo": { 74 | "serverUrl": "rtmps://myfooserver/myfooapp", 75 | "streamName": "myfoostream5", 76 | "status": "started" 77 | }, 78 | "bar": { 79 | "serverUrl": "rtmp://mybarserver/mybarapp", 80 | "streamName": "mybarstream5", 81 | "status": "live" 82 | } 83 | } 84 | }, 85 | "status": "started", 86 | "streamMode" : "manual", 87 | "streams" : [] 88 | }, { 89 | "id" : "832641bf-5dbf-41a1-ad94-fea213e59a92", 90 | "sessionId" : "SESSIONID", 91 | "projectId": 123456, 92 | "createdAt" : 1394321113000, 93 | "updatedAt": 1394321113000, 94 | "resolution": "640x480", 95 | "broadcastUrls": { 96 | "hls" : "http://tokbox.com.broadcast2.s3.amazonaws.com/123456%2F832641bf-5dbf-41a1-ad94-fea213e59a92.m3u8", 97 | "rtmp": { 98 | "foo": { 99 | "serverUrl": "rtmps://myfooserver/myfooapp", 100 | "streamName": "myfoostream6", 101 | "status": "started" 102 | }, 103 | "bar": { 104 | "serverUrl": "rtmp://mybarserver/mybarapp", 105 | "streamName": "mybarstream6", 106 | "status": "live" 107 | } 108 | } 109 | }, 110 | "status": "started", 111 | "streamMode" : "manual", 112 | "streams" : [] 113 | } ] 114 | } 115 | http_version: 116 | recorded_at: Fri, 21 Jan 2022 12:05:21 GMT 117 | recorded_with: VCR 6.0.0 118 | -------------------------------------------------------------------------------- /spec/cassettes/OpenTok_Broadcasts/for_many_broadcasts/should_return_count_number_of_broadcasts.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: get 5 | uri: https://api.opentok.com/v2/project/123456/broadcast?count=2 6 | body: 7 | encoding: US-ASCII 8 | string: '' 9 | headers: 10 | User-Agent: 11 | - OpenTok-Ruby-SDK/<%= version %> 12 | X-Opentok-Auth: 13 | - eyJpc3QiOiJwcm9qZWN0IiwiYWxnIjoiSFMyNTYifQ.eyJpc3MiOiIxMjM0NTYiLCJpYXQiOjE0OTI1MTA2NjAsImV4cCI6MTQ5MjUxMDk2MH0.BplMVhJWx4ld7KLKXqEmow6MjNPPFw9W8IHCMfeb120 14 | Accept-Encoding: 15 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 16 | Accept: 17 | - "*/*" 18 | response: 19 | status: 20 | code: 200 21 | message: OK 22 | headers: 23 | Server: 24 | - nginx 25 | Date: 26 | - Fri, 21 Jan 2022 12:05:21 GMT 27 | Content-Type: 28 | - application/json 29 | Transfer-Encoding: 30 | - chunked 31 | Connection: 32 | - keep-alive 33 | body: 34 | encoding: UTF-8 35 | string: |- 36 | { 37 | "count" : 2, 38 | "items" : [ { 39 | "id" : "ef546c5a-4fd7-4e59-ab3d-f1cfb4148d1d", 40 | "sessionId" : "SESSIONID", 41 | "projectId": 123456, 42 | "createdAt" : 1395187930000, 43 | "updatedAt": 1395187930000, 44 | "resolution": "640x480", 45 | "broadcastUrls": { 46 | "hls" : "http://tokbox.com.broadcast2.s3.amazonaws.com/123456%2F5350f06f-0166-402e-bc27-09ba54948512.m3u8", 47 | "rtmp": { 48 | "foo": { 49 | "serverUrl": "rtmps://myfooserver/myfooapp", 50 | "streamName": "myfoostream1", 51 | "status": "started" 52 | }, 53 | "bar": { 54 | "serverUrl": "rtmp://mybarserver/mybarapp", 55 | "streamName": "mybarstream1", 56 | "status": "live" 57 | } 58 | } 59 | }, 60 | "status": "started", 61 | "streamMode" : "manual", 62 | "streams" : [] 63 | }, { 64 | "id" : "f6e7ee58-d6cf-4a59-896b-6d56b158ec71", 65 | "sessionId" : "SESSIONID", 66 | "projectId": 123456, 67 | "createdAt" : 1395187910000, 68 | "updatedAt": 1395187910000, 69 | "resolution": "640x480", 70 | "broadcastUrls": { 71 | "hls" : "http://tokbox.com.broadcast2.s3.amazonaws.com/123456%2F5350f06f-0166-402e-bc27-09ba54948512.m3u8", 72 | "rtmp": { 73 | "foo": { 74 | "serverUrl": "rtmps://myfooserver/myfooapp", 75 | "streamName": "myfoostream2", 76 | "status": "started" 77 | }, 78 | "bar": { 79 | "serverUrl": "rtmp://mybarserver/mybarapp", 80 | "streamName": "mybarstream2", 81 | "status": "live" 82 | } 83 | } 84 | }, 85 | "status": "started", 86 | "streamMode" : "manual", 87 | "streams" : [] 88 | } ] 89 | } 90 | http_version: 91 | recorded_at: Fri, 21 Jan 2022 12:05:21 GMT 92 | recorded_with: VCR 6.0.0 93 | -------------------------------------------------------------------------------- /spec/cassettes/OpenTok_Broadcasts/removes_a_stream_from_a_broadcast.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: patch 5 | uri: https://api.opentok.com/v2/project/123456/broadcast/13dbcc23-af92-4862-9184-74b21815a814/streams 6 | body: 7 | encoding: UTF-8 8 | string: '{"removeStream":"12312312-3811-4726-b508-e41a0f96c68f"}' 9 | headers: 10 | User-Agent: 11 | - OpenTok-Ruby-SDK/<%= version %> 12 | X-Opentok-Auth: 13 | - eyJpc3QiOiJwcm9qZWN0IiwiYWxnIjoiSFMyNTYifQ.eyJpc3MiOiIxMjM0NTYiLCJpYXQiOjE0OTI1MTA2NjAsImV4cCI6MTQ5MjUxMDk2MH0.BplMVhJWx4ld7KLKXqEmow6MjNPPFw9W8IHCMfeb120 14 | Content-Type: 15 | - application/json 16 | Accept-Encoding: 17 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 18 | Accept: 19 | - "*/*" 20 | response: 21 | status: 22 | code: 204 23 | message: No Content 24 | headers: 25 | Server: 26 | - nginx 27 | Date: 28 | - Tue, 23 Nov 2021 20:49:23 GMT 29 | Connection: 30 | - keep-alive 31 | Set-Cookie: 32 | - AWSALBTG=IVCBek0mkrwLClWNRdLjy1iFNSsOxBPlYS4DBo6ihXHl5qScay403/clceKAPEMdaMxF6eUaou388eSdkjuZ9olWCDF49IGVNCP4gmF8O9Ajvjqhh/cVuzMKL5kOrkjSgjVouTyOyAT3K4NaPfM+U6sBd7UQ0HhTHgND5lsgfSu9Y27EKj8=; 33 | Expires=Tue, 30 Nov 2021 20:49:22 GMT; Path=/ 34 | - AWSALBTGCORS=IVCBek0mkrwLClWNRdLjy1iFNSsOxBPlYS4DBo6ihXHl5qScay403/clceKAPEMdaMxF6eUaou388eSdkjuZ9olWCDF49IGVNCP4gmF8O9Ajvjqhh/cVuzMKL5kOrkjSgjVouTyOyAT3K4NaPfM+U6sBd7UQ0HhTHgND5lsgfSu9Y27EKj8=; 35 | Expires=Tue, 30 Nov 2021 20:49:22 GMT; Path=/; SameSite=None; Secure 36 | recorded_at: Tue, 18 Apr 2017 10:17:40 GMT 37 | recorded_with: VCR 6.0.0 38 | -------------------------------------------------------------------------------- /spec/cassettes/OpenTok_Broadcasts/starts_a_broadcast_with_a_matching_multi_broadcast_tag_value_when_multiBroadcastTag_is_specified.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://api.opentok.com/v2/project/123456/broadcast 6 | body: 7 | encoding: UTF-8 8 | string: '{"sessionId":"SESSIONID","outputs":{"hls":{}},"multiBroadcastTag":"broadcast-1"}' 9 | headers: 10 | User-Agent: 11 | - OpenTok-Ruby-SDK/<%= version %> 12 | X-Opentok-Auth: 13 | - eyJpc3QiOiJwcm9qZWN0IiwiYWxnIjoiSFMyNTYifQ.eyJpc3MiOiIxMjM0NTYiLCJpYXQiOjE0OTI1MTA2NjAsImV4cCI6MTQ5MjUxMDk2MH0.BplMVhJWx4ld7KLKXqEmow6MjNPPFw9W8IHCMfeb120 14 | Content-Type: 15 | - application/json 16 | Accept-Encoding: 17 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 18 | Accept: 19 | - "*/*" 20 | response: 21 | status: 22 | code: 200 23 | message: OK 24 | headers: 25 | Server: 26 | - nginx 27 | Date: 28 | - Mon, 03 Oct 2022 11:11:31 GMT 29 | Content-Type: 30 | - application/json; charset=utf-8 31 | Connection: 32 | - keep-alive 33 | body: 34 | encoding: UTF-8 35 | string: |- 36 | { 37 | "id":"BROADCASTID", 38 | "sessionId":"SESSIONID", 39 | "projectId":123456, 40 | "createdAt":1538086900154, 41 | "broadcastUrls": 42 | { 43 | "hls":"https://cdn-broadcast001-pdx.tokbox.com/14787/14787_b930bf08-1c9f-4c55-ab04-7d192578c057.smil/playlist.m3u8" 44 | }, 45 | "updatedAt":1538086900489, 46 | "status":"started", 47 | "maxDuration":7200, 48 | "resolution":"640x480", 49 | "partnerId":100, 50 | "event":"broadcast", 51 | "multiBroadcastTag":"broadcast-1" 52 | } 53 | recorded_at: Tue, 18 Apr 2017 10:17:40 GMT 54 | recorded_with: VCR 6.0.0 55 | -------------------------------------------------------------------------------- /spec/cassettes/OpenTok_Broadcasts/starts_a_broadcast_with_a_multi_broadcast_tag_value_of_nil_when_multiBroadcastTag_not_specified.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://api.opentok.com/v2/project/123456/broadcast 6 | body: 7 | encoding: UTF-8 8 | string: '{"sessionId":"SESSIONID","outputs":{"hls":{}}}' 9 | headers: 10 | User-Agent: 11 | - OpenTok-Ruby-SDK/<%= version %> 12 | X-Opentok-Auth: 13 | - eyJpc3QiOiJwcm9qZWN0IiwiYWxnIjoiSFMyNTYifQ.eyJpc3MiOiIxMjM0NTYiLCJpYXQiOjE0OTI1MTA2NjAsImV4cCI6MTQ5MjUxMDk2MH0.BplMVhJWx4ld7KLKXqEmow6MjNPPFw9W8IHCMfeb120 14 | Content-Type: 15 | - application/json 16 | Accept-Encoding: 17 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 18 | Accept: 19 | - "*/*" 20 | response: 21 | status: 22 | code: 200 23 | message: OK 24 | headers: 25 | Server: 26 | - nginx 27 | Date: 28 | - Mon, 03 Oct 2022 11:11:31 GMT 29 | Content-Type: 30 | - application/json; charset=utf-8 31 | Connection: 32 | - keep-alive 33 | body: 34 | encoding: UTF-8 35 | string: |- 36 | { 37 | "id":"BROADCASTID", 38 | "sessionId":"SESSIONID", 39 | "projectId":123456, 40 | "createdAt":1538086900154, 41 | "broadcastUrls": 42 | { 43 | "hls":"https://cdn-broadcast001-pdx.tokbox.com/14787/14787_b930bf08-1c9f-4c55-ab04-7d192578c057.smil/playlist.m3u8" 44 | }, 45 | "updatedAt":1538086900489, 46 | "status":"started", 47 | "maxDuration":7200, 48 | "resolution":"640x480", 49 | "partnerId":100, 50 | "event":"broadcast" 51 | } 52 | recorded_at: Tue, 18 Apr 2017 10:17:40 GMT 53 | recorded_with: VCR 6.0.0 54 | -------------------------------------------------------------------------------- /spec/cassettes/OpenTok_Broadcasts/starts_a_broadcast_with_a_specified_multiBroadcastTag.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://api.opentok.com/v2/project/123456/broadcast 6 | body: 7 | encoding: UTF-8 8 | string: '{"sessionId":"SESSIONID","outputs":{"hls":{}},"multiBroadcastTag":"broadcast-1"}' 9 | headers: 10 | User-Agent: 11 | - OpenTok-Ruby-SDK/<%= version %> 12 | X-Opentok-Auth: 13 | - eyJpc3QiOiJwcm9qZWN0IiwiYWxnIjoiSFMyNTYifQ.eyJpc3MiOiIxMjM0NTYiLCJpYXQiOjE0OTI1MTA2NjAsImV4cCI6MTQ5MjUxMDk2MH0.BplMVhJWx4ld7KLKXqEmow6MjNPPFw9W8IHCMfeb120 14 | Content-Type: 15 | - application/json 16 | Accept-Encoding: 17 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 18 | Accept: 19 | - "*/*" 20 | response: 21 | status: 22 | code: 200 23 | message: OK 24 | headers: 25 | Server: 26 | - nginx 27 | Date: 28 | - Wed, 07 Sep 2022 13:52:17 GMT 29 | Content-Type: 30 | - application/json 31 | Connection: 32 | - keep-alive 33 | body: 34 | encoding: UTF-8 35 | string: |- 36 | { 37 | "id":"BROADCASTID", 38 | "sessionId":"SESSIONID", 39 | "projectId":123456, 40 | "createdAt":1538086900154, 41 | "broadcastUrls": 42 | { 43 | "hls":"https://cdn-broadcast001-pdx.tokbox.com/14787/14787_b930bf08-1c9f-4c55-ab04-7d192578c057.smil/playlist.m3u8" 44 | }, 45 | "updatedAt":1538086900489, 46 | "status":"started", 47 | "maxDuration":7200, 48 | "resolution":"640x480", 49 | "partnerId":100, 50 | "event":"broadcast", 51 | "multiBroadcastTag":"broadcast-1" 52 | } 53 | recorded_at: Tue, 18 Apr 2017 10:17:40 GMT 54 | recorded_with: VCR 6.0.0 55 | -------------------------------------------------------------------------------- /spec/cassettes/OpenTok_Broadcasts/starts_a_rtmp_broadcast.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://api.opentok.com/v2/project/123456/broadcast 6 | body: 7 | encoding: UTF-8 8 | string: '{"sessionId":"SESSIONID","outputs":{"hls":{},"rtmp":[{"id":"rubyTestStream","serverUrl":"rtmp://x.rtmp.youtube.com/live2","streamName":"66c9-jwuh-pquf-9x18"}]}}' 9 | headers: 10 | User-Agent: 11 | - OpenTok-Ruby-SDK/<%= version %> 12 | X-Opentok-Auth: 13 | - eyJpc3QiOiJwcm9qZWN0IiwiYWxnIjoiSFMyNTYifQ.eyJpc3MiOiIxMjM0NTYiLCJpYXQiOjE0OTI1MTA2NjAsImV4cCI6MTQ5MjUxMDk2MH0.BplMVhJWx4ld7KLKXqEmow6MjNPPFw9W8IHCMfeb120 14 | Content-Type: 15 | - application/json 16 | Accept-Encoding: "gzip;q=1.0,deflate;q=0.6,identity;q=0.3" 17 | Accept: "*/*" 18 | response: 19 | status: 20 | code: 200 21 | message: OK 22 | headers: 23 | Server: 24 | - nginx 25 | Date: 26 | - Thu, 27 Sep 2018 23:10:28 GMT 27 | Content-Type: 28 | - application/json 29 | Connection: 30 | - keep-alive 31 | body: 32 | encoding: UTF-8 33 | string: |- 34 | { 35 | "id":"BROADCASTID", 36 | "sessionId":"SESSIONID", 37 | "projectId":123456, 38 | "createdAt":1538086900154, 39 | "broadcastUrls": 40 | { 41 | "hls":"https://cdn-broadcast001-pdx.tokbox.com/14787/14787_b930bf08-1c9f-4c55-ab04-7d192578c057.smil/playlist.m3u8", 42 | "rtmp": 43 | [ 44 | { 45 | "status":"connecting", 46 | "id":"rubyTestStream", 47 | "serverUrl":"rtmp://x.rtmp.youtube.com/live2", 48 | "streamName":"66c9-jwuh-pquf-9x18" 49 | } 50 | ] 51 | }, 52 | "updatedAt":1538086900489, 53 | "status":"started", 54 | "maxDuration":7200, 55 | "resolution":"640x480", 56 | "partnerId":100, 57 | "event":"broadcast" 58 | } 59 | http_version: 60 | recorded_at: Tue, 18 Apr 2017 10:17:40 GMT 61 | recorded_with: VCR 2.8.0 62 | -------------------------------------------------------------------------------- /spec/cassettes/OpenTok_Broadcasts/stops_a_broadcast.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://api.opentok.com/v2/project/123456/broadcast/13dbcc23-af92-4862-9184-74b21815a814/stop 6 | body: 7 | encoding: UTF-8 8 | string: '' 9 | headers: 10 | User-Agent: 11 | - OpenTok-Ruby-SDK/<%= version %> 12 | X-Opentok-Auth: 13 | - eyJpc3QiOiJwcm9qZWN0IiwiYWxnIjoiSFMyNTYifQ.eyJpc3MiOiIxMjM0NTYiLCJpYXQiOjE0OTI1MTA2NjAsImV4cCI6MTQ5MjUxMDk2MH0.BplMVhJWx4ld7KLKXqEmow6MjNPPFw9W8IHCMfeb120 14 | Accept-Encoding: "gzip;q=1.0,deflate;q=0.6,identity;q=0.3" 15 | Accept: "*/*" 16 | response: 17 | status: 18 | code: 200 19 | message: OK 20 | headers: 21 | Server: 22 | - nginx 23 | Date: 24 | - Fri, 28 Sep 2018 19:23:21 GMT 25 | Content-Type: 26 | - application/json 27 | Connection: 28 | - keep-alive 29 | body: 30 | encoding: UTF-8 31 | string: |- 32 | { 33 | "id":"13dbcc23-af92-4862-9184-74b21815a814", 34 | "sessionId":"SESSIONID", 35 | "projectId":123456, 36 | "createdAt":1538162113387, 37 | "broadcastUrls":null, 38 | "updatedAt":1538162113387, 39 | "status":"stopped", 40 | "maxDuration":7200, 41 | "resolution":"640x480", 42 | "event":"broadcast", 43 | "partnerId":123456 44 | } 45 | http_version: 46 | recorded_at: Tue, 18 Apr 2017 10:17:40 GMT 47 | recorded_with: VCR 2.8.0 48 | -------------------------------------------------------------------------------- /spec/cassettes/OpenTok_Captions/receives_a_valid_response_when_starting_captions.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://api.opentok.com/v2/project/123456/captions 6 | body: 7 | encoding: UTF-8 8 | string: '{"sessionId":"SESSIONID","token":"TOKENID"}' 9 | headers: 10 | User-Agent: 11 | - OpenTok-Ruby-SDK/<%= version %> 12 | X-Opentok-Auth: 13 | - eyJpc3QiOiJwcm9qZWN0IiwiYWxnIjoiSFMyNTYifQ.eyJpc3MiOiIxMjM0NTYiLCJpYXQiOjE0OTI1MTA2NjAsImV4cCI6MTQ5MjUxMDk2MH0.BplMVhJWx4ld7KLKXqEmow6MjNPPFw9W8IHCMfeb120 14 | Content-Type: 15 | - application/json 16 | Accept-Encoding: 17 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 18 | Accept: 19 | - "*/*" 20 | response: 21 | status: 22 | code: 202 23 | message: Accepted 24 | headers: 25 | Date: 26 | - Tue, 05 Sep 2023 11:32:49 GMT 27 | Content-Type: 28 | - application/json; charset=utf-8 29 | Transfer-Encoding: 30 | - chunked 31 | Connection: 32 | - keep-alive 33 | Set-Cookie: 34 | - AWSALBTG=V0iIksb77idvUqENJbP7kHbxorCidH5rXzTdrmAq244qBgmkoAZJ+QZE0gPn/fKjmIEtO29S43zhxzH3X5Ao8Nf/8KMvioOduANad0cg6/rMMbSKhWdxNJkcePyrYLO/6voP37Lk8LamlXqv3QK6lj9SCvA+/wyUB6CV+i1JY8XSc1ba/+s=; 35 | Expires=Tue, 12 Sep 2023 11:32:49 GMT; Path=/ 36 | - AWSALBTGCORS=V0iIksb77idvUqENJbP7kHbxorCidH5rXzTdrmAq244qBgmkoAZJ+QZE0gPn/fKjmIEtO29S43zhxzH3X5Ao8Nf/8KMvioOduANad0cg6/rMMbSKhWdxNJkcePyrYLO/6voP37Lk8LamlXqv3QK6lj9SCvA+/wyUB6CV+i1JY8XSc1ba/+s=; 37 | Expires=Tue, 12 Sep 2023 11:32:49 GMT; Path=/; SameSite=None; Secure 38 | X-Opentok-Trace: 39 | - f=unknown&s=cerberus&u=B8FAC1E2-3DCE-40A9-9CC3-866750E7C7A5 40 | body: 41 | encoding: UTF-8 42 | string: '{ "captionsId": "7c0680fc-6274-4de5-a66f-d0648e8d3ac2" }' 43 | recorded_at: Tue, 18 Apr 2017 10:17:40 GMT 44 | recorded_with: VCR 6.0.0 45 | -------------------------------------------------------------------------------- /spec/cassettes/OpenTok_Captions/receives_a_valid_response_when_starting_captions_with_options.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://api.opentok.com/v2/project/123456/captions 6 | body: 7 | encoding: UTF-8 8 | string: '{"sessionId":"SESSIONID","token":"TOKENID","languageCode":"en-GB","maxDuration":5000,"partialCaptions":false,"statusCallbackUrl":"https://example.com/captions/status"}' 9 | headers: 10 | User-Agent: 11 | - OpenTok-Ruby-SDK/<%= version %> 12 | X-Opentok-Auth: 13 | - eyJpc3QiOiJwcm9qZWN0IiwiYWxnIjoiSFMyNTYifQ.eyJpc3MiOiIxMjM0NTYiLCJpYXQiOjE0OTI1MTA2NjAsImV4cCI6MTQ5MjUxMDk2MH0.BplMVhJWx4ld7KLKXqEmow6MjNPPFw9W8IHCMfeb120 14 | Content-Type: 15 | - application/json 16 | Accept-Encoding: 17 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 18 | Accept: 19 | - "*/*" 20 | response: 21 | status: 22 | code: 202 23 | message: Accepted 24 | headers: 25 | Date: 26 | - Tue, 05 Sep 2023 12:05:23 GMT 27 | Content-Type: 28 | - application/json; charset=utf-8 29 | Transfer-Encoding: 30 | - chunked 31 | Connection: 32 | - keep-alive 33 | Set-Cookie: 34 | - AWSALBTG=Qam0XgGzqhEaBC7TB9UprWCTZ6omkQZDorQLpkU8Kb3+iSIJsINH6Rh13nWnaLryAUc08wZEEc0VAi6ZXVa5gVLE/5YeIvMT9WP8VzJLFyvQ/bMe7TIDvp/QronHO4tohNGpvrFQxCC5LElWX5JnN3sCr5WpUHqEPQr0jz9TtUmKJYIh0So=; 35 | Expires=Tue, 12 Sep 2023 12:05:23 GMT; Path=/ 36 | - AWSALBTGCORS=Qam0XgGzqhEaBC7TB9UprWCTZ6omkQZDorQLpkU8Kb3+iSIJsINH6Rh13nWnaLryAUc08wZEEc0VAi6ZXVa5gVLE/5YeIvMT9WP8VzJLFyvQ/bMe7TIDvp/QronHO4tohNGpvrFQxCC5LElWX5JnN3sCr5WpUHqEPQr0jz9TtUmKJYIh0So=; 37 | Expires=Tue, 12 Sep 2023 12:05:23 GMT; Path=/; SameSite=None; Secure 38 | X-Opentok-Trace: 39 | - f=unknown&s=cerberus&u=5DB017B0-6FC7-444F-BDE9-20D3CBA7B2EA 40 | body: 41 | encoding: UTF-8 42 | string: '{ "captionsId": "7c0680fc-6274-4de5-a66f-d0648e8d3ac2" }' 43 | recorded_at: Tue, 18 Apr 2017 10:17:40 GMT 44 | recorded_with: VCR 6.0.0 45 | -------------------------------------------------------------------------------- /spec/cassettes/OpenTok_Captions/receives_a_valid_response_when_stopping_captions.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://api.opentok.com/v2/project/123456/captions/CAPTIONSID/stop 6 | body: 7 | encoding: UTF-8 8 | string: '' 9 | headers: 10 | User-Agent: 11 | - OpenTok-Ruby-SDK/<%= version %> 12 | X-Opentok-Auth: 13 | - eyJpc3QiOiJwcm9qZWN0IiwiYWxnIjoiSFMyNTYifQ.eyJpc3MiOiIxMjM0NTYiLCJpYXQiOjE0OTI1MTA2NjAsImV4cCI6MTQ5MjUxMDk2MH0.BplMVhJWx4ld7KLKXqEmow6MjNPPFw9W8IHCMfeb120 14 | Content-Type: 15 | - application/json 16 | Accept-Encoding: 17 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 18 | Accept: 19 | - "*/*" 20 | response: 21 | status: 22 | code: 202 23 | message: Accepted 24 | headers: 25 | Date: 26 | - Tue, 05 Sep 2023 11:30:55 GMT 27 | Content-Type: 28 | - application/json; charset=utf-8 29 | Transfer-Encoding: 30 | - chunked 31 | Connection: 32 | - keep-alive 33 | Set-Cookie: 34 | - AWSALBTG=LJIybl0y9LXphBJqNdoYf94M2EQTLnT/IhYp4UD+lzvSSZfKfdshtXSXDJ+gplgMuZ+3zg7mtnQoUF7ZhM2IRiL6VYJq88ltUPP075OdNgDwWRpYLq+doFLXeee4skbljcUpgTAWkCp1MReHhYdiTO8G36cgW9hPyWE9/jIMcfhN6HzVv5Q=; 35 | Expires=Tue, 12 Sep 2023 11:30:55 GMT; Path=/ 36 | - AWSALBTGCORS=LJIybl0y9LXphBJqNdoYf94M2EQTLnT/IhYp4UD+lzvSSZfKfdshtXSXDJ+gplgMuZ+3zg7mtnQoUF7ZhM2IRiL6VYJq88ltUPP075OdNgDwWRpYLq+doFLXeee4skbljcUpgTAWkCp1MReHhYdiTO8G36cgW9hPyWE9/jIMcfhN6HzVv5Q=; 37 | Expires=Tue, 12 Sep 2023 11:30:55 GMT; Path=/; SameSite=None; Secure 38 | X-Opentok-Trace: 39 | - f=unknown&s=cerberus&u=22ECEF08-1EBD-4554-BF7B-04857DE8616A 40 | body: 41 | encoding: UTF-8 42 | string: '' 43 | recorded_at: Tue, 18 Apr 2017 10:17:40 GMT 44 | recorded_with: VCR 6.0.0 45 | -------------------------------------------------------------------------------- /spec/cassettes/OpenTok_Connections/forces_a_connection_to_be_terminated.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: delete 5 | uri: https://api.opentok.com/v2/project/123456/session/SESSIONID/connection/CONNID 6 | body: 7 | encoding: US-ASCII 8 | string: '' 9 | headers: 10 | User-Agent: 11 | - OpenTok-Ruby-SDK/<%= version %> 12 | X-Opentok-Auth: 13 | - eyJpc3QiOiJwcm9qZWN0IiwiYWxnIjoiSFMyNTYifQ.eyJpc3MiOiIxMjM0NTYiLCJpYXQiOjE0OTI1MTA2NjAsImV4cCI6MTQ5MjUxMDk2MH0.BplMVhJWx4ld7KLKXqEmow6MjNPPFw9W8IHCMfeb120 14 | Content-Type: 15 | - application/json 16 | Accept-Encoding: "gzip;q=1.0,deflate;q=0.6,identity;q=0.3" 17 | Accept: "*/*" 18 | response: 19 | status: 20 | code: 204 21 | message: OK 22 | headers: 23 | Server: 24 | - nginx 25 | Date: 26 | - Wed, 29 Aug 2018 19:41:26 GMT 27 | Content-Type: 28 | - application/json 29 | Connection: 30 | - keep-alive 31 | Content-Length: 32 | - '73' 33 | body: 34 | encoding: UTF-8 35 | string: '{"code":-1,"message":"Issuer not found","description":"Issuer not found"}' 36 | http_version: 37 | recorded_at: Tue, 18 Apr 2017 10:17:40 GMT 38 | recorded_with: VCR 2.8.0 39 | -------------------------------------------------------------------------------- /spec/cassettes/OpenTok_OpenTok/when_initialized_properly/_create_session/creates_always_archived_sessions.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://api.opentok.com/session/create 6 | body: 7 | encoding: UTF-8 8 | string: archiveMode=always&p2p.preference=disabled 9 | headers: 10 | User-Agent: 11 | - OpenTok-Ruby-SDK/<%= version %> 12 | X-Opentok-Auth: 13 | - eyJpc3QiOiJwcm9qZWN0IiwiYWxnIjoiSFMyNTYifQ.eyJpc3MiOiIxMjM0NTYiLCJpYXQiOjE0OTI1MTA2NjAsImV4cCI6MTQ5MjUxMDk2MH0.BplMVhJWx4ld7KLKXqEmow6MjNPPFw9W8IHCMfeb120 14 | Accept-Encoding: "gzip;q=1.0,deflate;q=0.6,identity;q=0.3" 15 | Accept: "*/*" 16 | response: 17 | status: 18 | code: 200 19 | message: OK 20 | headers: 21 | Server: 22 | - nginx 23 | Date: 24 | - Mon, 17 Mar 2014 08:48:55 GMT 25 | Content-Type: 26 | - text/xml 27 | Connection: 28 | - keep-alive 29 | Access-Control-Allow-Origin: 30 | - '*' 31 | X-Tb-Host: 32 | - oms504-nyc.tokbox.com 33 | Content-Length: 34 | - '282' 35 | body: 36 | encoding: UTF-8 37 | string: 1_MX4xMjM0NTZ-fk1vbiBNYXIgMTcgMDA6NDE6MzEgUERUIDIwMTR-MC42ODM3ODk1MzQ0OTQyODA4fg123456Mon 38 | Mar 17 01:48:55 PDT 2014 39 | http_version: 40 | recorded_at: Mon, 17 Mar 2014 08:48:54 GMT 41 | recorded_with: VCR 2.8.0 42 | -------------------------------------------------------------------------------- /spec/cassettes/OpenTok_OpenTok/when_initialized_properly/_create_session/creates_always_archived_sessions_with_a_set_archive_name.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://api.opentok.com/session/create 6 | body: 7 | encoding: UTF-8 8 | string: archiveMode=always&archiveName=foo&p2p.preference=disabled 9 | headers: 10 | User-Agent: 11 | - OpenTok-Ruby-SDK/<%= version %> 12 | X-Opentok-Auth: 13 | - eyJpc3QiOiJwcm9qZWN0IiwiYWxnIjoiSFMyNTYifQ.eyJpc3MiOiIxMjM0NTYiLCJpYXQiOjE0OTI1MTA2NjAsImV4cCI6MTQ5MjUxMDk2MH0.BplMVhJWx4ld7KLKXqEmow6MjNPPFw9W8IHCMfeb120 14 | Accept-Encoding: 15 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 16 | Accept: 17 | - "*/*" 18 | response: 19 | status: 20 | code: 200 21 | message: OK 22 | headers: 23 | Server: 24 | - nginx 25 | Date: 26 | - Mon, 12 Jun 2023 16:17:36 GMT 27 | Content-Type: 28 | - text/xml 29 | Connection: 30 | - keep-alive 31 | Access-Control-Allow-Origin: 32 | - '*' 33 | X-Tb-Host: 34 | - fms503-nyc.tokbox.com 35 | Content-Length: 36 | - '282' 37 | body: 38 | encoding: UTF-8 39 | string: 1_MX4xMjM0NTZ-fk1vbiBNYXIgMTcgMDA6NDE6MzEgUERUIDIwMTR-MC42ODM3ODk1MzQ0OTQyODA4fg123456Mon 40 | Jun 12 16:17:36 GMT 2023 41 | recorded_at: Tue, 18 Apr 2017 10:17:40 GMT 42 | recorded_with: VCR 6.0.0 43 | -------------------------------------------------------------------------------- /spec/cassettes/OpenTok_OpenTok/when_initialized_properly/_create_session/creates_always_archived_sessions_with_a_set_archive_name_and_resolution.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://api.opentok.com/session/create 6 | body: 7 | encoding: UTF-8 8 | string: archiveMode=always&archiveName=foo&archiveResolution=720x1280&p2p.preference=disabled 9 | headers: 10 | User-Agent: 11 | - OpenTok-Ruby-SDK/<%= version %> 12 | X-Opentok-Auth: 13 | - eyJpc3QiOiJwcm9qZWN0IiwiYWxnIjoiSFMyNTYifQ.eyJpc3MiOiIxMjM0NTYiLCJpYXQiOjE0OTI1MTA2NjAsImV4cCI6MTQ5MjUxMDk2MH0.BplMVhJWx4ld7KLKXqEmow6MjNPPFw9W8IHCMfeb120 14 | Accept-Encoding: 15 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 16 | Accept: 17 | - "*/*" 18 | response: 19 | status: 20 | code: 200 21 | message: OK 22 | headers: 23 | Server: 24 | - nginx 25 | Date: 26 | - Mon, 12 Jun 2023 16:17:36 GMT 27 | Content-Type: 28 | - text/xml 29 | Connection: 30 | - keep-alive 31 | Access-Control-Allow-Origin: 32 | - '*' 33 | X-Tb-Host: 34 | - fms503-nyc.tokbox.com 35 | Content-Length: 36 | - '282' 37 | body: 38 | encoding: UTF-8 39 | string: 1_MX4xMjM0NTZ-fk1vbiBNYXIgMTcgMDA6NDE6MzEgUERUIDIwMTR-MC42ODM3ODk1MzQ0OTQyODA4fg123456Mon 40 | Jun 12 16:17:36 GMT 2023 41 | recorded_at: Tue, 18 Apr 2017 10:17:40 GMT 42 | recorded_with: VCR 6.0.0 43 | -------------------------------------------------------------------------------- /spec/cassettes/OpenTok_OpenTok/when_initialized_properly/_create_session/creates_always_archived_sessions_with_a_set_archive_resolution.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://api.opentok.com/session/create 6 | body: 7 | encoding: UTF-8 8 | string: archiveMode=always&archiveResolution=720x1280&p2p.preference=disabled 9 | headers: 10 | User-Agent: 11 | - OpenTok-Ruby-SDK/<%= version %> 12 | X-Opentok-Auth: 13 | - eyJpc3QiOiJwcm9qZWN0IiwiYWxnIjoiSFMyNTYifQ.eyJpc3MiOiIxMjM0NTYiLCJpYXQiOjE0OTI1MTA2NjAsImV4cCI6MTQ5MjUxMDk2MH0.BplMVhJWx4ld7KLKXqEmow6MjNPPFw9W8IHCMfeb120 14 | Accept-Encoding: 15 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 16 | Accept: 17 | - "*/*" 18 | response: 19 | status: 20 | code: 200 21 | message: OK 22 | headers: 23 | Server: 24 | - nginx 25 | Date: 26 | - Mon, 12 Jun 2023 16:17:36 GMT 27 | Content-Type: 28 | - text/xml 29 | Connection: 30 | - keep-alive 31 | Access-Control-Allow-Origin: 32 | - '*' 33 | X-Tb-Host: 34 | - fms503-nyc.tokbox.com 35 | Content-Length: 36 | - '282' 37 | body: 38 | encoding: UTF-8 39 | string: 1_MX4xMjM0NTZ-fk1vbiBNYXIgMTcgMDA6NDE6MzEgUERUIDIwMTR-MC42ODM3ODk1MzQ0OTQyODA4fg123456Mon 40 | Jun 12 16:17:36 GMT 2023 41 | recorded_at: Tue, 18 Apr 2017 10:17:40 GMT 42 | recorded_with: VCR 6.0.0 43 | -------------------------------------------------------------------------------- /spec/cassettes/OpenTok_OpenTok/when_initialized_properly/_create_session/creates_default_sessions.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://api.opentok.com/session/create 6 | body: 7 | encoding: UTF-8 8 | string: p2p.preference=enabled 9 | headers: 10 | User-Agent: 11 | - OpenTok-Ruby-SDK/<%= version %> 12 | X-Opentok-Auth: 13 | - eyJpc3QiOiJwcm9qZWN0IiwiYWxnIjoiSFMyNTYifQ.eyJpc3MiOiIxMjM0NTYiLCJpYXQiOjE0OTI1MTA2NjAsImV4cCI6MTQ5MjUxMDk2MH0.BplMVhJWx4ld7KLKXqEmow6MjNPPFw9W8IHCMfeb120 14 | Accept-Encoding: "gzip;q=1.0,deflate;q=0.6,identity;q=0.3" 15 | Accept: "*/*" 16 | response: 17 | status: 18 | code: 200 19 | message: OK 20 | headers: 21 | Server: 22 | - nginx 23 | Date: 24 | - Mon, 17 Mar 2014 07:41:31 GMT 25 | Content-Type: 26 | - text/xml 27 | Connection: 28 | - keep-alive 29 | Access-Control-Allow-Origin: 30 | - '*' 31 | X-Tb-Host: 32 | - fms503-nyc.tokbox.com 33 | Content-Length: 34 | - '282' 35 | body: 36 | encoding: UTF-8 37 | string: 1_MX4xMjM0NTZ-fk1vbiBNYXIgMTcgMDA6NDE6MzEgUERUIDIwMTR-MC42ODM3ODk1MzQ0OTQyODA4fg123456Mon 38 | Mar 17 00:41:31 PDT 2014 39 | http_version: 40 | recorded_at: Mon, 17 Mar 2014 07:41:30 GMT 41 | recorded_with: VCR 2.8.0 42 | -------------------------------------------------------------------------------- /spec/cassettes/OpenTok_OpenTok/when_initialized_properly/_create_session/creates_e2ee_sessions.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://api.opentok.com/session/create 6 | body: 7 | encoding: UTF-8 8 | string: e2ee=true&p2p.preference=disabled 9 | headers: 10 | User-Agent: 11 | - OpenTok-Ruby-SDK/<%= version %> 12 | X-Opentok-Auth: 13 | - eyJpc3QiOiJwcm9qZWN0IiwiYWxnIjoiSFMyNTYifQ.eyJpc3MiOiIxMjM0NTYiLCJpYXQiOjE0OTI1MTA2NjAsImV4cCI6MTQ5MjUxMDk2MH0.BplMVhJWx4ld7KLKXqEmow6MjNPPFw9W8IHCMfeb120 14 | Accept-Encoding: "gzip;q=1.0,deflate;q=0.6,identity;q=0.3" 15 | Accept: "*/*" 16 | response: 17 | status: 18 | code: 200 19 | message: OK 20 | headers: 21 | Server: 22 | - nginx 23 | Date: 24 | - Tue, 18 Apr 2023 16:17:40 GMT 25 | Content-Type: 26 | - text/xml 27 | Connection: 28 | - keep-alive 29 | Access-Control-Allow-Origin: 30 | - '*' 31 | X-Tb-Host: 32 | - mantis503-nyc.tokbox.com 33 | Content-Length: 34 | - '304' 35 | body: 36 | encoding: UTF-8 37 | string: 1_MX4xMjM0NTZ-MTIuMzQuNTYuNzh-TW9uIE1hciAxNyAwMTo0ODo1NSBQRFQgMjAxNH4wLjM0MTM0MzE0MDIyOTU4Mjh-123456Tue 38 | Apr 18 08:17:40 PDT 2023 39 | recorded_at: Tue, 18 Apr 2023 16:17:40 GMT 40 | recorded_with: VCR 6.0.0 41 | -------------------------------------------------------------------------------- /spec/cassettes/OpenTok_OpenTok/when_initialized_properly/_create_session/creates_relayed_media_sessions.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://api.opentok.com/session/create 6 | body: 7 | encoding: UTF-8 8 | string: p2p.preference=enabled 9 | headers: 10 | User-Agent: 11 | - OpenTok-Ruby-SDK/<%= version %> 12 | X-Opentok-Auth: 13 | - eyJpc3QiOiJwcm9qZWN0IiwiYWxnIjoiSFMyNTYifQ.eyJpc3MiOiIxMjM0NTYiLCJpYXQiOjE0OTI1MTA2NjAsImV4cCI6MTQ5MjUxMDk2MH0.BplMVhJWx4ld7KLKXqEmow6MjNPPFw9W8IHCMfeb120 14 | Accept-Encoding: "gzip;q=1.0,deflate;q=0.6,identity;q=0.3" 15 | Accept: "*/*" 16 | response: 17 | status: 18 | code: 200 19 | message: OK 20 | headers: 21 | Server: 22 | - nginx 23 | Date: 24 | - Mon, 17 Mar 2014 08:48:55 GMT 25 | Content-Type: 26 | - text/xml 27 | Connection: 28 | - keep-alive 29 | Access-Control-Allow-Origin: 30 | - '*' 31 | X-Tb-Host: 32 | - oms504-nyc.tokbox.com 33 | Content-Length: 34 | - '282' 35 | body: 36 | encoding: UTF-8 37 | string: 1_MX4xMjM0NTZ-fk1vbiBNYXIgMTcgMDA6NDE6MzEgUERUIDIwMTR-MC42ODM3ODk1MzQ0OTQyODA4fg123456Mon 38 | Mar 17 01:48:55 PDT 2014 39 | http_version: 40 | recorded_at: Mon, 17 Mar 2014 08:48:54 GMT 41 | recorded_with: VCR 2.8.0 42 | -------------------------------------------------------------------------------- /spec/cassettes/OpenTok_OpenTok/when_initialized_properly/_create_session/creates_relayed_media_sessions_for_invalid_media_modes.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://api.opentok.com/session/create 6 | body: 7 | encoding: UTF-8 8 | string: p2p.preference=enabled 9 | headers: 10 | User-Agent: 11 | - OpenTok-Ruby-SDK/<%= version %> 12 | X-Opentok-Auth: 13 | - eyJpc3QiOiJwcm9qZWN0IiwiYWxnIjoiSFMyNTYifQ.eyJpc3MiOiIxMjM0NTYiLCJpYXQiOjE0OTI1MTA2NjAsImV4cCI6MTQ5MjUxMDk2MH0.BplMVhJWx4ld7KLKXqEmow6MjNPPFw9W8IHCMfeb120 14 | Accept-Encoding: "gzip;q=1.0,deflate;q=0.6,identity;q=0.3" 15 | Accept: "*/*" 16 | response: 17 | status: 18 | code: 200 19 | message: OK 20 | headers: 21 | Server: 22 | - nginx 23 | Date: 24 | - Mon, 17 Mar 2014 07:41:31 GMT 25 | Content-Type: 26 | - text/xml 27 | Connection: 28 | - keep-alive 29 | Access-Control-Allow-Origin: 30 | - '*' 31 | X-Tb-Host: 32 | - fms503-nyc.tokbox.com 33 | Content-Length: 34 | - '282' 35 | body: 36 | encoding: UTF-8 37 | string: 1_MX4xMjM0NTZ-fk1vbiBNYXIgMTcgMDA6NDE6MzEgUERUIDIwMTR-MC42ODM3ODk1MzQ0OTQyODA4fg123456Mon 38 | Mar 17 00:41:31 PDT 2014 39 | http_version: 40 | recorded_at: Mon, 17 Mar 2014 07:41:30 GMT 41 | recorded_with: VCR 2.8.0 42 | -------------------------------------------------------------------------------- /spec/cassettes/OpenTok_OpenTok/when_initialized_properly/_create_session/creates_relayed_media_sessions_with_a_location_hint.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://api.opentok.com/session/create 6 | body: 7 | encoding: UTF-8 8 | string: location=12.34.56.78&p2p.preference=enabled 9 | headers: 10 | User-Agent: 11 | - OpenTok-Ruby-SDK/<%= version %> 12 | X-Opentok-Auth: 13 | - eyJpc3QiOiJwcm9qZWN0IiwiYWxnIjoiSFMyNTYifQ.eyJpc3MiOiIxMjM0NTYiLCJpYXQiOjE0OTI1MTA2NjAsImV4cCI6MTQ5MjUxMDk2MH0.BplMVhJWx4ld7KLKXqEmow6MjNPPFw9W8IHCMfeb120 14 | Accept-Encoding: "gzip;q=1.0,deflate;q=0.6,identity;q=0.3" 15 | Accept: "*/*" 16 | response: 17 | status: 18 | code: 200 19 | message: OK 20 | headers: 21 | Server: 22 | - nginx 23 | Date: 24 | - Mon, 17 Mar 2014 09:00:07 GMT 25 | Content-Type: 26 | - text/xml 27 | Connection: 28 | - keep-alive 29 | Access-Control-Allow-Origin: 30 | - '*' 31 | X-Tb-Host: 32 | - oms506-nyc.tokbox.com 33 | Content-Length: 34 | - '298' 35 | body: 36 | encoding: UTF-8 37 | string: 1_MX4xMjM0NTZ-MTIuMzQuNTYuNzh-TW9uIE1hciAxNyAwMjowMDowNyBQRFQgMjAxNH4wLjIxMzUyNTY0ODkyNzMxNjA3fg123456Mon 38 | Mar 17 02:00:07 PDT 2014 39 | http_version: 40 | recorded_at: Mon, 17 Mar 2014 09:00:06 GMT 41 | recorded_with: VCR 2.8.0 42 | -------------------------------------------------------------------------------- /spec/cassettes/OpenTok_OpenTok/when_initialized_properly/_create_session/creates_routed_media_sessions.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://api.opentok.com/session/create 6 | body: 7 | encoding: UTF-8 8 | string: p2p.preference=disabled 9 | headers: 10 | User-Agent: 11 | - OpenTok-Ruby-SDK/<%= version %> 12 | X-Opentok-Auth: 13 | - eyJpc3QiOiJwcm9qZWN0IiwiYWxnIjoiSFMyNTYifQ.eyJpc3MiOiIxMjM0NTYiLCJpYXQiOjE0OTI1MTA2NjAsImV4cCI6MTQ5MjUxMDk2MH0.BplMVhJWx4ld7KLKXqEmow6MjNPPFw9W8IHCMfeb120 14 | Accept-Encoding: "gzip;q=1.0,deflate;q=0.6,identity;q=0.3" 15 | Accept: "*/*" 16 | response: 17 | status: 18 | code: 200 19 | message: OK 20 | headers: 21 | Server: 22 | - nginx 23 | Date: 24 | - Mon, 17 Mar 2014 09:00:07 GMT 25 | Content-Type: 26 | - text/xml 27 | Connection: 28 | - keep-alive 29 | Access-Control-Allow-Origin: 30 | - '*' 31 | X-Tb-Host: 32 | - fms502-nyc.tokbox.com 33 | Content-Length: 34 | - '282' 35 | body: 36 | encoding: UTF-8 37 | string: 1_MX4xMjM0NTZ-fk1vbiBNYXIgMTcgMDI6MDA6MDcgUERUIDIwMTR-MC42MjkyMTk3OTM3MTQ1ODI5fg123456Mon 38 | Mar 17 02:00:07 PDT 2014 39 | http_version: 40 | recorded_at: Mon, 17 Mar 2014 09:00:06 GMT 41 | recorded_with: VCR 2.8.0 42 | -------------------------------------------------------------------------------- /spec/cassettes/OpenTok_OpenTok/when_initialized_properly/_create_session/creates_routed_media_sessions_with_a_location_hint.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://api.opentok.com/session/create 6 | body: 7 | encoding: UTF-8 8 | string: location=12.34.56.78&p2p.preference=disabled 9 | headers: 10 | User-Agent: 11 | - OpenTok-Ruby-SDK/<%= version %> 12 | X-Opentok-Auth: 13 | - eyJpc3QiOiJwcm9qZWN0IiwiYWxnIjoiSFMyNTYifQ.eyJpc3MiOiIxMjM0NTYiLCJpYXQiOjE0OTI1MTA2NjAsImV4cCI6MTQ5MjUxMDk2MH0.BplMVhJWx4ld7KLKXqEmow6MjNPPFw9W8IHCMfeb120 14 | Accept-Encoding: "gzip;q=1.0,deflate;q=0.6,identity;q=0.3" 15 | Accept: "*/*" 16 | response: 17 | status: 18 | code: 200 19 | message: OK 20 | headers: 21 | Server: 22 | - nginx 23 | Date: 24 | - Mon, 17 Mar 2014 09:00:07 GMT 25 | Content-Type: 26 | - text/xml 27 | Connection: 28 | - keep-alive 29 | Access-Control-Allow-Origin: 30 | - '*' 31 | X-Tb-Host: 32 | - mantis504-nyc.tokbox.com 33 | Content-Length: 34 | - '298' 35 | body: 36 | encoding: UTF-8 37 | string: 1_MX4xMjM0NTZ-MTIuMzQuNTYuNzh-TW9uIE1hciAxNyAwMjowMDowNyBQRFQgMjAxNH4wLjIxMzUyNTY0ODkyNzMxNjA3fg123456Mon 38 | Mar 17 02:00:07 PDT 2014 39 | http_version: 40 | recorded_at: Mon, 17 Mar 2014 09:00:06 GMT 41 | recorded_with: VCR 2.8.0 42 | -------------------------------------------------------------------------------- /spec/cassettes/OpenTok_OpenTok/when_initialized_properly/_create_session/creates_sessions_with_a_location_hint.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://api.opentok.com/session/create 6 | body: 7 | encoding: UTF-8 8 | string: location=12.34.56.78&p2p.preference=enabled 9 | headers: 10 | User-Agent: 11 | - OpenTok-Ruby-SDK/<%= version %> 12 | X-Opentok-Auth: 13 | - eyJpc3QiOiJwcm9qZWN0IiwiYWxnIjoiSFMyNTYifQ.eyJpc3MiOiIxMjM0NTYiLCJpYXQiOjE0OTI1MTA2NjAsImV4cCI6MTQ5MjUxMDk2MH0.BplMVhJWx4ld7KLKXqEmow6MjNPPFw9W8IHCMfeb120 14 | Accept-Encoding: "gzip;q=1.0,deflate;q=0.6,identity;q=0.3" 15 | Accept: "*/*" 16 | response: 17 | status: 18 | code: 200 19 | message: OK 20 | headers: 21 | Server: 22 | - nginx 23 | Date: 24 | - Mon, 17 Mar 2014 08:48:55 GMT 25 | Content-Type: 26 | - text/xml 27 | Connection: 28 | - keep-alive 29 | Access-Control-Allow-Origin: 30 | - '*' 31 | X-Tb-Host: 32 | - mantis503-nyc.tokbox.com 33 | Content-Length: 34 | - '296' 35 | body: 36 | encoding: UTF-8 37 | string: 1_MX4xMjM0NTZ-MTIuMzQuNTYuNzh-TW9uIE1hciAxNyAwMTo0ODo1NSBQRFQgMjAxNH4wLjM0MTM0MzE0MDIyOTU4Mjh-123456Mon 38 | Mar 17 01:48:55 PDT 2014 39 | http_version: 40 | recorded_at: Mon, 17 Mar 2014 08:48:54 GMT 41 | recorded_with: VCR 2.8.0 42 | -------------------------------------------------------------------------------- /spec/cassettes/OpenTok_OpenTok/when_initialized_properly/with_an_addendum_to_the_user_agent_string/should_append_the_addendum_to_the_user_agent_header.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://api.opentok.com/session/create 6 | body: 7 | encoding: UTF-8 8 | string: p2p.preference=enabled 9 | headers: 10 | User-Agent: 11 | - OpenTok-Ruby-SDK/<%= version %> BOOYAH 12 | X-Opentok-Auth: 13 | - eyJpc3QiOiJwcm9qZWN0IiwiYWxnIjoiSFMyNTYifQ.eyJpc3MiOiIxMjM0NTYiLCJpYXQiOjE0OTI1MTA2NjAsImV4cCI6MTQ5MjUxMDk2MH0.BplMVhJWx4ld7KLKXqEmow6MjNPPFw9W8IHCMfeb120 14 | Accept-Encoding: "gzip;q=1.0,deflate;q=0.6,identity;q=0.3" 15 | Accept: "*/*" 16 | response: 17 | status: 18 | code: 200 19 | message: OK 20 | headers: 21 | Server: 22 | - nginx 23 | Date: 24 | - Mon, 17 Mar 2014 07:41:31 GMT 25 | Content-Type: 26 | - text/xml 27 | Connection: 28 | - keep-alive 29 | Access-Control-Allow-Origin: 30 | - '*' 31 | X-Tb-Host: 32 | - fms503-nyc.tokbox.com 33 | Content-Length: 34 | - '282' 35 | body: 36 | encoding: UTF-8 37 | string: 1_MX4xMjM0NTZ-fk1vbiBNYXIgMTcgMDA6NDE6MzEgUERUIDIwMTR-MC42ODM3ODk1MzQ0OTQyODA4fg123456Mon 38 | Mar 17 00:41:31 PDT 2014 39 | http_version: 40 | recorded_at: Thu, 06 Aug 2015 02:09:13 GMT 41 | recorded_with: VCR 2.8.0 42 | -------------------------------------------------------------------------------- /spec/cassettes/OpenTok_Renders/finds_an_Experience_Composer_render.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: get 5 | uri: https://api.opentok.com/v2/project/123456/render/80abaf0d-25a3-4efc-968f-6268d620668d 6 | body: 7 | encoding: US-ASCII 8 | string: '' 9 | headers: 10 | User-Agent: 11 | - OpenTok-Ruby-SDK/<%= version %> 12 | X-Opentok-Auth: 13 | - eyJpc3QiOiJwcm9qZWN0IiwiYWxnIjoiSFMyNTYifQ.eyJpc3MiOiIxMjM0NTYiLCJpYXQiOjE0OTI1MTA2NjAsImV4cCI6MTQ5MjUxMDk2MH0.BplMVhJWx4ld7KLKXqEmow6MjNPPFw9W8IHCMfeb120 14 | Accept-Encoding: 15 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 16 | Accept: 17 | - "*/*" 18 | response: 19 | status: 20 | code: 200 21 | message: OK 22 | headers: 23 | Server: 24 | - nginx 25 | Date: 26 | - Thu, 15 Sep 2022 10:25:36 GMT 27 | Content-Type: 28 | - application/json 29 | Connection: 30 | - keep-alive 31 | body: 32 | encoding: UTF-8 33 | string: |- 34 | { 35 | "id": "80abaf0d-25a3-4efc-968f-6268d620668d", 36 | "sessionId": "SESSIONID", 37 | "projectId": "e2343f23456g34709d2443a234", 38 | "createdAt": 1437676551000, 39 | "updatedAt": 1437676551000, 40 | "url": "https://example.com/my-render", 41 | "resolution": "1280x720", 42 | "status": "started", 43 | "streamId": "e32445b743678c98230f238" 44 | } 45 | recorded_at: Tue, 18 Apr 2017 10:17:40 GMT 46 | recorded_with: VCR 6.0.0 47 | -------------------------------------------------------------------------------- /spec/cassettes/OpenTok_Renders/for_many_renders/should_return_count_number_of_renders.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: get 5 | uri: https://api.opentok.com/v2/project/123456/render?count=2 6 | body: 7 | encoding: US-ASCII 8 | string: '' 9 | headers: 10 | User-Agent: 11 | - OpenTok-Ruby-SDK/<%= version %> 12 | X-Opentok-Auth: 13 | - eyJpc3QiOiJwcm9qZWN0IiwiYWxnIjoiSFMyNTYifQ.eyJpc3MiOiIxMjM0NTYiLCJpYXQiOjE0OTI1MTA2NjAsImV4cCI6MTQ5MjUxMDk2MH0.BplMVhJWx4ld7KLKXqEmow6MjNPPFw9W8IHCMfeb120 14 | Accept-Encoding: 15 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 16 | Accept: 17 | - "*/*" 18 | response: 19 | status: 20 | code: 200 21 | message: OK 22 | headers: 23 | Server: 24 | - nginx 25 | Date: 26 | - Thu, 15 Sep 2022 11:32:24 GMT 27 | Content-Type: 28 | - application/json 29 | Connection: 30 | - keep-alive 31 | body: 32 | encoding: UTF-8 33 | string: |- 34 | { 35 | "count":2, 36 | "items":[ 37 | { 38 | "id":"80abaf0d-25a3-4efc-968f-6268d620668d", 39 | "sessionId":"1_MX4yNzA4NjYxMn5-MTU0NzA4MDUyMTEzNn5sOXU5ZnlWYXplRnZGblV4RUo3dXJpZk1-fg", 40 | "projectId":"27086612", 41 | "createdAt":1547080532099, 42 | "updatedAt":1547080532099, 43 | "url": "https://example.com/my-render", 44 | "resolution": "1280x720", 45 | "status": "started", 46 | "streamId": "d2334b35690a92f78945" 47 | }, 48 | { 49 | "id":"d95f6496-df6e-4f49-86d6-832e00303602", 50 | "sessionId":"2_MX4yNzA4NjYxMn5-MTU0NzA4MDUwMDc2MH5STWRiSE1jZjVoV3lBQU9nN2JuNElUV3V-fg", 51 | "projectId":"27086612", 52 | "createdAt":1547080511760, 53 | "updatedAt":1547080518965, 54 | "url": "https://example.com/my-render", 55 | "resolution": "1280x720", 56 | "status":"stopped", 57 | "streamId": "d2334b35690a92f78945", 58 | "reason":"Max duration exceeded" 59 | } 60 | ] 61 | } 62 | recorded_at: Tue, 18 Apr 2017 10:17:40 GMT 63 | recorded_with: VCR 6.0.0 64 | -------------------------------------------------------------------------------- /spec/cassettes/OpenTok_Renders/for_many_renders/should_return_part_of_the_renders_when_using_offset_and_count.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: get 5 | uri: https://api.opentok.com/v2/project/123456/render?count=2&offset=2 6 | body: 7 | encoding: US-ASCII 8 | string: '' 9 | headers: 10 | User-Agent: 11 | - OpenTok-Ruby-SDK/<%= version %> 12 | X-Opentok-Auth: 13 | - eyJpc3QiOiJwcm9qZWN0IiwiYWxnIjoiSFMyNTYifQ.eyJpc3MiOiIxMjM0NTYiLCJpYXQiOjE0OTI1MTA2NjAsImV4cCI6MTQ5MjUxMDk2MH0.BplMVhJWx4ld7KLKXqEmow6MjNPPFw9W8IHCMfeb120 14 | Accept-Encoding: 15 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 16 | Accept: 17 | - "*/*" 18 | response: 19 | status: 20 | code: 200 21 | message: OK 22 | headers: 23 | Server: 24 | - nginx 25 | Date: 26 | - Thu, 15 Sep 2022 11:34:05 GMT 27 | Content-Type: 28 | - application/json 29 | Connection: 30 | - keep-alive 31 | body: 32 | encoding: UTF-8 33 | string: |- 34 | { 35 | "count":2, 36 | "items":[ 37 | { 38 | "id":"96abaf0d-25a3-4efc-968f-6268d620668d", 39 | "sessionId":"3_MX4yNzA4NjYxMn5-MTU0NzA4MDUyMTEzNn5sOXU5ZnlWYXplRnZGblV4RUo3dXJpZk1-fg", 40 | "projectId":"27086612", 41 | "createdAt":1547080532099, 42 | "updatedAt":1547080532099, 43 | "url": "https://example.com/my-render", 44 | "resolution": "1280x720", 45 | "status": "started", 46 | "streamId": "d2334b35690a92f78946" 47 | }, 48 | { 49 | "id":"c34f6496-df6e-4f49-86d6-832e00303602", 50 | "sessionId":"4_MX4yNzA4NjYxMn5-MTU0NzA4MDUwMDc2MH5STWRiSE1jZjVoV3lBQU9nN2JuNElUV3V-fg", 51 | "projectId":"27086612", 52 | "createdAt":1547080511760, 53 | "updatedAt":1547080518965, 54 | "url": "https://example.com/my-render", 55 | "resolution": "1280x720", 56 | "status":"stopped", 57 | "streamId": "d2334b35690a92f78912", 58 | "reason":"Stop Requested" 59 | } 60 | ] 61 | } 62 | recorded_at: Tue, 18 Apr 2017 10:17:40 GMT 63 | recorded_with: VCR 6.0.0 64 | -------------------------------------------------------------------------------- /spec/cassettes/OpenTok_Renders/for_many_renders/should_return_renders_with_an_offset.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: get 5 | uri: https://api.opentok.com/v2/project/123456/render?offset=3 6 | body: 7 | encoding: US-ASCII 8 | string: '' 9 | headers: 10 | User-Agent: 11 | - OpenTok-Ruby-SDK/<%= version %> 12 | X-Opentok-Auth: 13 | - eyJpc3QiOiJwcm9qZWN0IiwiYWxnIjoiSFMyNTYifQ.eyJpc3MiOiIxMjM0NTYiLCJpYXQiOjE0OTI1MTA2NjAsImV4cCI6MTQ5MjUxMDk2MH0.BplMVhJWx4ld7KLKXqEmow6MjNPPFw9W8IHCMfeb120 14 | Accept-Encoding: 15 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 16 | Accept: 17 | - "*/*" 18 | response: 19 | status: 20 | code: 200 21 | message: OK 22 | headers: 23 | Server: 24 | - nginx 25 | Date: 26 | - Thu, 15 Sep 2022 11:29:00 GMT 27 | Content-Type: 28 | - application/json 29 | Connection: 30 | - keep-alive 31 | body: 32 | encoding: UTF-8 33 | string: |- 34 | { 35 | "count":3, 36 | "items":[ 37 | { 38 | "id":"c34f6496-df6e-4f49-86d6-832e00303602", 39 | "sessionId":"4_MX4yNzA4NjYxMn5-MTU0NzA4MDUwMDc2MH5STWRiSE1jZjVoV3lBQU9nN2JuNElUV3V-fg", 40 | "projectId":"27086612", 41 | "createdAt":1547080511760, 42 | "updatedAt":1547080518965, 43 | "url": "https://example.com/my-render", 44 | "resolution": "1280x720", 45 | "status":"stopped", 46 | "streamId": "d2334b35690a92f78912", 47 | "reason":"Stop Requested" 48 | }, 49 | { 50 | "id":"52abaf0d-25a3-4efc-968f-6268d620668d", 51 | "sessionId":"1_MX4yNzA4NjYxMn5-MTU0NzA4MDUyMTEzNn5sOXU5ZnlWYXplRnZGblV4RUo3dXJpZk1-fg", 52 | "projectId":"27086612", 53 | "createdAt":1547080532099, 54 | "updatedAt":1547080532099, 55 | "url": "https://example.com/my-render", 56 | "resolution": "1280x720", 57 | "status": "started", 58 | "streamId": "d2334b35690a92f78948" 59 | }, 60 | { 61 | "id":"a87f6496-df6e-4f49-86d6-832e00303602", 62 | "sessionId":"2_MX4yNzA4NjYxMn5-MTU0NzA4MDUwMDc2MH5STWRiSE1jZjVoV3lBQU9nN2JuNElUV3V-fg", 63 | "projectId":"27086612", 64 | "createdAt":1547080511760, 65 | "updatedAt":1547080518965, 66 | "url": "https://example.com/my-render", 67 | "resolution": "1280x720", 68 | "status":"starting", 69 | "streamId": "d2334b35690a92f78947" 70 | } 71 | ] 72 | } 73 | recorded_at: Tue, 18 Apr 2017 10:17:40 GMT 74 | recorded_with: VCR 6.0.0 75 | -------------------------------------------------------------------------------- /spec/cassettes/OpenTok_Renders/starts_an_Experience_Composer_render.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://api.opentok.com/v2/project/123456/render 6 | body: 7 | encoding: UTF-8 8 | string: '{"sessionId":"SESSIONID","token":"TOKEN","url":"https://example.com/my-render"}' 9 | headers: 10 | User-Agent: 11 | - OpenTok-Ruby-SDK/<%= version %> 12 | X-Opentok-Auth: 13 | - eyJpc3QiOiJwcm9qZWN0IiwiYWxnIjoiSFMyNTYifQ.eyJpc3MiOiIxMjM0NTYiLCJpYXQiOjE0OTI1MTA2NjAsImV4cCI6MTQ5MjUxMDk2MH0.BplMVhJWx4ld7KLKXqEmow6MjNPPFw9W8IHCMfeb120 14 | Content-Type: 15 | - application/json 16 | Accept-Encoding: 17 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 18 | Accept: 19 | - "*/*" 20 | response: 21 | status: 22 | code: 202 23 | message: Accepted 24 | headers: 25 | Server: 26 | - nginx 27 | Date: 28 | - Thu, 15 Sep 2022 10:25:36 GMT 29 | Content-Type: 30 | - application/json 31 | Connection: 32 | - keep-alive 33 | body: 34 | encoding: UTF-8 35 | string: |- 36 | { 37 | "id": "80abaf0d-25a3-4efc-968f-6268d620668d", 38 | "sessionId": "SESSIONID", 39 | "projectId": "e2343f23456g34709d2443a234", 40 | "createdAt": 1437676551000, 41 | "updatedAt": 1437676551000, 42 | "url": "https://example.com/my-render", 43 | "resolution": "1280x720", 44 | "status": "starting", 45 | "streamId": "e32445b743678c98230f238" 46 | } 47 | recorded_at: Tue, 18 Apr 2017 10:17:40 GMT 48 | recorded_with: VCR 6.0.0 49 | -------------------------------------------------------------------------------- /spec/cassettes/OpenTok_Renders/stops_an_Experience_Composer_render.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: delete 5 | uri: https://api.opentok.com/v2/project/123456/render/80abaf0d-25a3-4efc-968f-6268d620668d 6 | body: 7 | encoding: US-ASCII 8 | string: '' 9 | headers: 10 | User-Agent: 11 | - OpenTok-Ruby-SDK/<%= version %> 12 | X-Opentok-Auth: 13 | - eyJpc3QiOiJwcm9qZWN0IiwiYWxnIjoiSFMyNTYifQ.eyJpc3MiOiIxMjM0NTYiLCJpYXQiOjE0OTI1MTA2NjAsImV4cCI6MTQ5MjUxMDk2MH0.BplMVhJWx4ld7KLKXqEmow6MjNPPFw9W8IHCMfeb120 14 | Accept-Encoding: 15 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 16 | Accept: 17 | - "*/*" 18 | response: 19 | status: 20 | code: 204 21 | message: No Content 22 | headers: 23 | Date: 24 | - Thu, 15 Sep 2022 10:51:54 GMT 25 | Connection: 26 | - keep-alive 27 | recorded_at: Tue, 18 Apr 2017 10:17:40 GMT 28 | recorded_with: VCR 6.0.0 29 | -------------------------------------------------------------------------------- /spec/cassettes/OpenTok_Signals/receives_a_valid_response_for_a_connection.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://api.opentok.com/v2/project/123456/session/SESSIONID/connection/CONNID/signal 6 | body: 7 | encoding: UTF-8 8 | string: '{"type":"chat","data":"Hello"}' 9 | headers: 10 | User-Agent: 11 | - OpenTok-Ruby-SDK/<%= version %> 12 | X-Opentok-Auth: 13 | - eyJpc3QiOiJwcm9qZWN0IiwiYWxnIjoiSFMyNTYifQ.eyJpc3MiOiIxMjM0NTYiLCJpYXQiOjE0OTI1MTA2NjAsImV4cCI6MTQ5MjUxMDk2MH0.BplMVhJWx4ld7KLKXqEmow6MjNPPFw9W8IHCMfeb120 14 | Content-Type: 15 | - application/json 16 | Accept-Encoding: "gzip;q=1.0,deflate;q=0.6,identity;q=0.3" 17 | Accept: "*/*" 18 | response: 19 | status: 20 | code: 204 21 | message: OK 22 | headers: 23 | Server: 24 | - nginx 25 | Date: 26 | - Tue, 28 Aug 2018 22:01:54 GMT 27 | Content-Type: 28 | - application/xml 29 | Connection: 30 | - keep-alive 31 | Content-Length: 32 | - '177' 33 | body: 34 | encoding: UTF-8 35 | string: -1Issuer 36 | not foundIssuer not found 37 | http_version: 38 | recorded_at: Tue, 18 Apr 2017 10:17:40 GMT 39 | recorded_with: VCR 2.8.0 40 | -------------------------------------------------------------------------------- /spec/cassettes/OpenTok_Signals/receives_a_valid_response_for_all_connections.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://api.opentok.com/v2/project/123456/session/SESSIONID/signal 6 | body: 7 | encoding: UTF-8 8 | string: '{"type":"chat","data":"Hello"}' 9 | headers: 10 | User-Agent: 11 | - OpenTok-Ruby-SDK/<%= version %> 12 | X-Opentok-Auth: 13 | - eyJpc3QiOiJwcm9qZWN0IiwiYWxnIjoiSFMyNTYifQ.eyJpc3MiOiIxMjM0NTYiLCJpYXQiOjE0OTI1MTA2NjAsImV4cCI6MTQ5MjUxMDk2MH0.BplMVhJWx4ld7KLKXqEmow6MjNPPFw9W8IHCMfeb120 14 | Content-Type: 15 | - application/json 16 | Accept-Encoding: "gzip;q=1.0,deflate;q=0.6,identity;q=0.3" 17 | Accept: "*/*" 18 | response: 19 | status: 20 | code: 204 21 | message: OK 22 | headers: 23 | Server: 24 | - nginx 25 | Date: 26 | - Tue, 28 Aug 2018 21:31:02 GMT 27 | Content-Type: 28 | - application/xml 29 | Connection: 30 | - keep-alive 31 | Content-Length: 32 | - '177' 33 | body: 34 | encoding: UTF-8 35 | string: -1Issuer 36 | not foundIssuer not found 37 | http_version: 38 | recorded_at: Tue, 18 Apr 2017 10:17:40 GMT 39 | recorded_with: VCR 2.8.0 40 | -------------------------------------------------------------------------------- /spec/cassettes/OpenTok_Sip/_play_dtmf_to_connection/returns_a_200_response_code_when_passed_a_valid_dtmf_digit_string.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://api.opentok.com/v2/project/123456/session/SESSIONID/connection/CONNID/play-dtmf 6 | body: 7 | encoding: UTF-8 8 | string: '{"digits":"0123456789*#p"}' 9 | headers: 10 | User-Agent: 11 | - OpenTok-Ruby-SDK/<%= version %> 12 | X-Opentok-Auth: 13 | - eyJpc3QiOiJwcm9qZWN0IiwiYWxnIjoiSFMyNTYifQ.eyJpc3MiOiIxMjM0NTYiLCJpYXQiOjE0OTI1MTA2NjAsImV4cCI6MTQ5MjUxMDk2MH0.BplMVhJWx4ld7KLKXqEmow6MjNPPFw9W8IHCMfeb120 14 | Content-Type: 15 | - application/json 16 | Accept-Encoding: 17 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 18 | Accept: 19 | - "*/*" 20 | response: 21 | status: 22 | code: 200 23 | message: OK 24 | headers: 25 | Server: 26 | - nginx 27 | Date: 28 | - Mon, 01 Nov 2021 12:27:19 GMT 29 | Content-Type: 30 | - application/xml 31 | Content-Length: 32 | - '177' 33 | Connection: 34 | - keep-alive 35 | body: 36 | encoding: UTF-8 37 | string: "" 38 | recorded_at: Tue, 18 Apr 2017 10:17:40 GMT 39 | recorded_with: VCR 6.0.0 40 | -------------------------------------------------------------------------------- /spec/cassettes/OpenTok_Sip/_play_dtmf_to_session/returns_a_200_response_code_when_passed_a_valid_dtmf_digit_string.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://api.opentok.com/v2/project/123456/session/SESSIONID/play-dtmf 6 | body: 7 | encoding: UTF-8 8 | string: '{"digits":"0123456789*#p"}' 9 | headers: 10 | User-Agent: 11 | - OpenTok-Ruby-SDK/<%= version %> 12 | X-Opentok-Auth: 13 | - eyJpc3QiOiJwcm9qZWN0IiwiYWxnIjoiSFMyNTYifQ.eyJpc3MiOiIxMjM0NTYiLCJpYXQiOjE0OTI1MTA2NjAsImV4cCI6MTQ5MjUxMDk2MH0.BplMVhJWx4ld7KLKXqEmow6MjNPPFw9W8IHCMfeb120 14 | Content-Type: 15 | - application/json 16 | Accept-Encoding: 17 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 18 | Accept: 19 | - "*/*" 20 | response: 21 | status: 22 | code: 200 23 | message: OK 24 | headers: 25 | Server: 26 | - nginx 27 | Date: 28 | - Mon, 01 Nov 2021 12:35:08 GMT 29 | Content-Type: 30 | - application/xml 31 | Content-Length: 32 | - '177' 33 | Connection: 34 | - keep-alive 35 | body: 36 | encoding: UTF-8 37 | string: "" 38 | recorded_at: Tue, 18 Apr 2017 10:17:40 GMT 39 | recorded_with: VCR 6.0.0 40 | -------------------------------------------------------------------------------- /spec/cassettes/OpenTok_Sip/receives_a_valid_response.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://api.opentok.com/v2/project/123456/dial 6 | body: 7 | encoding: UTF-8 8 | string: '{"sessionId":"SESSIONID","token":"TOKENID","sip":{"uri":"sip:+15128675309@acme.pstn.example.com;transport=tls","auth":{"username":"bob","password":"abc123"},"secure":"true","video":"true","observeForceMute":"true"}}' 9 | headers: 10 | User-Agent: 11 | - OpenTok-Ruby-SDK/<%= version %> 12 | X-Opentok-Auth: 13 | - eyJpc3QiOiJwcm9qZWN0IiwiYWxnIjoiSFMyNTYifQ.eyJpc3MiOiIxMjM0NTYiLCJpYXQiOjE0OTI1MTA2NjAsImV4cCI6MTQ5MjUxMDk2MH0.BplMVhJWx4ld7KLKXqEmow6MjNPPFw9W8IHCMfeb120 14 | Content-Type: 15 | - application/json 16 | Accept-Encoding: "gzip;q=1.0,deflate;q=0.6,identity;q=0.3" 17 | Accept: "*/*" 18 | response: 19 | status: 20 | code: 200 21 | message: OK 22 | headers: 23 | Server: 24 | - nginx 25 | Date: 26 | - Mon, 17 Apr 2017 22:40:03 GMT 27 | Content-Type: 28 | - application/json 29 | Connection: 30 | - keep-alive 31 | Content-Length: 32 | - '311' 33 | Strict-Transport-Security: 34 | - max-age=31536000; includeSubdomains 35 | body: 36 | encoding: UTF-8 37 | string: '{"id":"2299ba24-a6de-417c-88f7-28da54a441cf","projectId":"123456","sessionId":"SESSIONID","connectionId":"833a7182-61a5-49d4-baae-c324b09953af","streamId":"b1963d15-537f-459a-be89-e00fc310b82b","createdAt":1492468803946,"updatedAt":1492468803946}' 38 | http_version: 39 | recorded_at: Mon, 17 Apr 2017 22:40:01 GMT 40 | recorded_with: VCR 2.8.0 41 | -------------------------------------------------------------------------------- /spec/cassettes/OpenTok_Streams/disables_the_mute_state_of_a_session.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://api.opentok.com/v2/project/123456/session/SESSIONID/mute 6 | body: 7 | encoding: UTF-8 8 | string: '{"active":"false"}' 9 | headers: 10 | User-Agent: 11 | - OpenTok-Ruby-SDK/<%= version %> 12 | X-Opentok-Auth: 13 | - eyJpc3QiOiJwcm9qZWN0IiwiYWxnIjoiSFMyNTYifQ.eyJpc3MiOiIxMjM0NTYiLCJpYXQiOjE0OTI1MTA2NjAsImV4cCI6MTQ5MjUxMDk2MH0.BplMVhJWx4ld7KLKXqEmow6MjNPPFw9W8IHCMfeb120 14 | Content-Type: 15 | - application/json 16 | Accept-Encoding: 17 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 18 | Accept: 19 | - "*/*" 20 | response: 21 | status: 22 | code: 200 23 | message: OK 24 | headers: 25 | Server: 26 | - nginx 27 | Date: 28 | - Thu, 13 Jan 2022 15:37:24 GMT 29 | Content-Length: 30 | - '0' 31 | Connection: 32 | - close 33 | body: 34 | encoding: UTF-8 35 | string: '' 36 | recorded_at: Tue, 18 Apr 2017 10:17:40 GMT 37 | recorded_with: VCR 6.0.0 38 | -------------------------------------------------------------------------------- /spec/cassettes/OpenTok_Streams/forces_all_current_and_future_streams_in_a_session_to_be_muted.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://api.opentok.com/v2/project/123456/session/SESSIONID/mute 6 | body: 7 | encoding: UTF-8 8 | string: '{"active":"true"}' 9 | headers: 10 | User-Agent: 11 | - OpenTok-Ruby-SDK/<%= version %> 12 | X-Opentok-Auth: 13 | - eyJpc3QiOiJwcm9qZWN0IiwiYWxnIjoiSFMyNTYifQ.eyJpc3MiOiIxMjM0NTYiLCJpYXQiOjE0OTI1MTA2NjAsImV4cCI6MTQ5MjUxMDk2MH0.BplMVhJWx4ld7KLKXqEmow6MjNPPFw9W8IHCMfeb120 14 | Content-Type: 15 | - application/json 16 | Accept-Encoding: 17 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 18 | Accept: 19 | - "*/*" 20 | response: 21 | status: 22 | code: 200 23 | message: OK 24 | headers: 25 | Server: 26 | - nginx 27 | Date: 28 | - Fri, 29 Oct 2021 11:48:19 GMT 29 | Content-Type: 30 | - application/json 31 | Content-Length: 32 | - '0' 33 | Connection: 34 | - close 35 | body: 36 | encoding: UTF-8 37 | string: '' 38 | recorded_at: Tue, 18 Apr 2017 10:17:40 GMT 39 | recorded_with: VCR 6.0.0 40 | -------------------------------------------------------------------------------- /spec/cassettes/OpenTok_Streams/forces_all_current_and_future_streams_in_a_session_to_be_muted_except_specified_excluded_streams.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://api.opentok.com/v2/project/123456/session/SESSIONID/mute 6 | body: 7 | encoding: UTF-8 8 | string: '{"excludedStreams":["b1963d15-537f-459a-be89-e00fc310b82b"],"active":"true"}' 9 | headers: 10 | User-Agent: 11 | - OpenTok-Ruby-SDK/<%= version %> 12 | X-Opentok-Auth: 13 | - eyJpc3QiOiJwcm9qZWN0IiwiYWxnIjoiSFMyNTYifQ.eyJpc3MiOiIxMjM0NTYiLCJpYXQiOjE0OTI1MTA2NjAsImV4cCI6MTQ5MjUxMDk2MH0.BplMVhJWx4ld7KLKXqEmow6MjNPPFw9W8IHCMfeb120 14 | Content-Type: 15 | - application/json 16 | Accept-Encoding: 17 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 18 | Accept: 19 | - "*/*" 20 | response: 21 | status: 22 | code: 200 23 | message: OK 24 | headers: 25 | Server: 26 | - nginx 27 | Date: 28 | - Fri, 29 Oct 2021 12:01:42 GMT 29 | Content-Type: 30 | - application/json 31 | Content-Length: 32 | - '0' 33 | Connection: 34 | - keep-alive 35 | body: 36 | encoding: UTF-8 37 | string: '' 38 | recorded_at: Tue, 18 Apr 2017 10:17:40 GMT 39 | recorded_with: VCR 6.0.0 40 | -------------------------------------------------------------------------------- /spec/cassettes/OpenTok_Streams/forces_the_specified_stream_to_be_muted.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://api.opentok.com/v2/project/123456/session/SESSIONID/stream/STREAMID/mute 6 | body: 7 | encoding: UTF-8 8 | string: '' 9 | headers: 10 | User-Agent: 11 | - OpenTok-Ruby-SDK/<%= version %> 12 | X-Opentok-Auth: 13 | - eyJpc3QiOiJwcm9qZWN0IiwiYWxnIjoiSFMyNTYifQ.eyJpc3MiOiIxMjM0NTYiLCJpYXQiOjE0OTI1MTA2NjAsImV4cCI6MTQ5MjUxMDk2MH0.BplMVhJWx4ld7KLKXqEmow6MjNPPFw9W8IHCMfeb120 14 | Content-Type: 15 | - application/json 16 | Accept-Encoding: 17 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 18 | Accept: 19 | - "*/*" 20 | response: 21 | status: 22 | code: 200 23 | message: OK 24 | headers: 25 | Server: 26 | - nginx 27 | Date: 28 | - Fri, 29 Oct 2021 11:01:54 GMT 29 | Content-Type: 30 | - application/json 31 | Content-Length: 32 | - '0' 33 | Connection: 34 | - keep-alive 35 | body: 36 | encoding: UTF-8 37 | string: '' 38 | recorded_at: Tue, 18 Apr 2017 10:17:40 GMT 39 | recorded_with: VCR 6.0.0 40 | -------------------------------------------------------------------------------- /spec/cassettes/OpenTok_Streams/get_all_streams_information.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: get 5 | uri: https://api.opentok.com/v2/project/123456/session/SESSIONID/stream 6 | body: 7 | encoding: US-ASCII 8 | string: '' 9 | headers: 10 | User-Agent: 11 | - OpenTok-Ruby-SDK/<%= version %> 12 | X-Opentok-Auth: 13 | - eyJpc3QiOiJwcm9qZWN0IiwiYWxnIjoiSFMyNTYifQ.eyJpc3MiOiIxMjM0NTYiLCJpYXQiOjE0OTI1MTA2NjAsImV4cCI6MTQ5MjUxMDk2MH0.BplMVhJWx4ld7KLKXqEmow6MjNPPFw9W8IHCMfeb120 14 | Content-Type: 15 | - application/json 16 | Accept-Encoding: "gzip;q=1.0,deflate;q=0.6,identity;q=0.3" 17 | Accept: "*/*" 18 | response: 19 | status: 20 | code: 200 21 | message: OK 22 | headers: 23 | Server: 24 | - nginx 25 | Date: 26 | - Mon, 24 Sep 2018 20:41:24 GMT 27 | Content-Type: 28 | - application/json 29 | Connection: 30 | - keep-alive 31 | Content-Length: 32 | - '73' 33 | body: 34 | encoding: UTF-8 35 | string: |- 36 | { 37 | "count": 2, 38 | "items": [ 39 | { 40 | "id": "1234356-0a06-46a2-8ea8-074e64d43422", 41 | "videoType": "camera", 42 | "name": "", 43 | "layoutClassList": ["full", "focus"] 44 | }, 45 | { 46 | "id": "8b732909-0a06-46a2-8ea8-074e64d43422", 47 | "videoType": "screen", 48 | "name": "", 49 | "layoutClassList": ["full"] 50 | } 51 | ] 52 | } 53 | http_version: 54 | recorded_at: Tue, 18 Apr 2017 10:17:40 GMT 55 | recorded_with: VCR 2.8.0 56 | -------------------------------------------------------------------------------- /spec/cassettes/OpenTok_Streams/get_specific_stream_information.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: get 5 | uri: https://api.opentok.com/v2/project/123456/session/SESSIONID/stream/STREAMID 6 | body: 7 | encoding: US-ASCII 8 | string: '' 9 | headers: 10 | User-Agent: 11 | - OpenTok-Ruby-SDK/<%= version %> 12 | X-Opentok-Auth: 13 | - eyJpc3QiOiJwcm9qZWN0IiwiYWxnIjoiSFMyNTYifQ.eyJpc3MiOiIxMjM0NTYiLCJpYXQiOjE0OTI1MTA2NjAsImV4cCI6MTQ5MjUxMDk2MH0.BplMVhJWx4ld7KLKXqEmow6MjNPPFw9W8IHCMfeb120 14 | Content-Type: 15 | - application/json 16 | Accept-Encoding: "gzip;q=1.0,deflate;q=0.6,identity;q=0.3" 17 | Accept: "*/*" 18 | response: 19 | status: 20 | code: 200 21 | message: OK 22 | headers: 23 | Server: 24 | - nginx 25 | Date: 26 | - Mon, 24 Sep 2018 20:41:24 GMT 27 | Content-Type: 28 | - application/json 29 | Connection: 30 | - keep-alive 31 | Content-Length: 32 | - '0' 33 | body: 34 | encoding: UTF-8 35 | string: |- 36 | { 37 | "id": "8b732909-0a06-46a2-8ea8-074e64d43422", 38 | "videoType": "camera", 39 | "name": "", 40 | "layoutClassList": ["full"] 41 | } 42 | http_version: 43 | recorded_at: Tue, 18 Apr 2017 10:17:40 GMT 44 | recorded_with: VCR 2.8.0 45 | -------------------------------------------------------------------------------- /spec/cassettes/OpenTok_Streams/layout_working_on_two_stream_list.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: put 5 | uri: https://api.opentok.com/v2/project/123456/session/SESSIONID/stream 6 | body: 7 | encoding: UTF-8 8 | string: '{"items":[{"id":"8b732909-0a06-46a2-8ea8-074e64d43422","layoutClassList":["full"]},{"id":"8b732909-0a06-46a2-8ea8-074e64d43423","layoutClassList":["full","focus"]}]}' 9 | headers: 10 | User-Agent: 11 | - OpenTok-Ruby-SDK/<%= version %> 12 | X-Opentok-Auth: 13 | - eyJpc3QiOiJwcm9qZWN0IiwiYWxnIjoiSFMyNTYifQ.eyJpc3MiOiIxMjM0NTYiLCJpYXQiOjE0OTI1MTA2NjAsImV4cCI6MTQ5MjUxMDk2MH0.BplMVhJWx4ld7KLKXqEmow6MjNPPFw9W8IHCMfeb120 14 | Content-Type: 15 | - application/json 16 | Accept-Encoding: "gzip;q=1.0,deflate;q=0.6,identity;q=0.3" 17 | Accept: "*/*" 18 | response: 19 | status: 20 | code: 200 21 | message: OK 22 | headers: 23 | Server: 24 | - nginx 25 | Date: 26 | - Wed, 26 Sep 2018 22:48:29 GMT 27 | Content-Type: 28 | - application/json 29 | Connection: 30 | - keep-alive 31 | Content-Length: 32 | - '73' 33 | body: 34 | encoding: UTF-8 35 | string: '{"code":-1,"message":"Issuer not found","description":"Issuer not found"}' 36 | http_version: 37 | recorded_at: Tue, 18 Apr 2017 10:17:40 GMT 38 | recorded_with: VCR 2.8.0 39 | -------------------------------------------------------------------------------- /spec/cassettes/OpenTok_WebSocket/receives_a_valid_response.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://api.opentok.com/v2/project/123456/connect 6 | body: 7 | encoding: UTF-8 8 | string: '{"sessionId":"SESSIONID","token":"TOKENID","websocket":{"uri":"ws://service.com/wsendpoint"}}' 9 | headers: 10 | User-Agent: 11 | - OpenTok-Ruby-SDK/<%= version %> 12 | X-Opentok-Auth: 13 | - eyJpc3QiOiJwcm9qZWN0IiwiYWxnIjoiSFMyNTYifQ.eyJpc3MiOiIxMjM0NTYiLCJpYXQiOjE0OTI1MTA2NjAsImV4cCI6MTQ5MjUxMDk2MH0.BplMVhJWx4ld7KLKXqEmow6MjNPPFw9W8IHCMfeb120 14 | Content-Type: 15 | - application/json 16 | Accept-Encoding: 17 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 18 | Accept: 19 | - "*/*" 20 | response: 21 | status: 22 | code: 200 23 | message: OK 24 | headers: 25 | Date: 26 | - Sat, 06 Aug 2022 18:10:28 GMT 27 | Content-Type: 28 | - application/json 29 | Content-Length: 30 | - '73' 31 | Connection: 32 | - keep-alive 33 | body: 34 | encoding: UTF-8 35 | string: '{"id":"2299ba24-a6de-417c-88f7-28da54a441cf","connectionId":"833a7182-61a5-49d4-baae-c324b09953af"}' 36 | recorded_at: Tue, 18 Apr 2017 10:17:40 GMT 37 | recorded_with: VCR 6.0.0 38 | -------------------------------------------------------------------------------- /spec/matchers/token.rb: -------------------------------------------------------------------------------- 1 | require "rspec/matchers" 2 | 3 | require "base64" 4 | require "openssl" 5 | require "addressable/uri" 6 | require "jwt" 7 | 8 | RSpec::Matchers.define :carry_t1_token_data do |input_data| 9 | option_to_token_key = { 10 | :api_key => :partner_id, 11 | :data => :connection_data, 12 | :initial_layout_class_list => :initial_layout_class_list 13 | } 14 | match do |token| 15 | decoded_token = Base64.decode64(token[4..token.length]) 16 | token_data_array = decoded_token.split(':').collect do |token_part| 17 | token_part_array_array = Addressable::URI.form_unencode(token_part) 18 | token_part_array = token_part_array_array.map do |array| 19 | { array[0].to_sym => array[1] } 20 | end 21 | token_part_array.reduce Hash.new, :merge 22 | end 23 | token_data = token_data_array.reduce Hash.new, :merge 24 | check_token_data = lambda { |key, value| 25 | key = option_to_token_key[key] if option_to_token_key.has_key? key 26 | if token_data.has_key? key 27 | unless value.nil? 28 | return token_data[key] == value.to_s 29 | end 30 | return true 31 | end 32 | false 33 | } 34 | unless input_data.respond_to? :all? 35 | return check_token_data.call(input_data, nil) 36 | end 37 | input_data.all? { |k, v| check_token_data.call(k, v) } 38 | end 39 | end 40 | 41 | RSpec::Matchers.define :carry_valid_t1_token_signature do |api_secret| 42 | match do |token| 43 | decoded_token = Base64.decode64(token[4..token.length]) 44 | metadata, data_string = decoded_token.split(':') 45 | digest = OpenSSL::Digest.new('sha1') 46 | # form_unencode returns an array of arrays, annoying so hardcoded lookup 47 | # expected format: [["partner_id", "..."], ["sig", "..."]] 48 | signature = Addressable::URI.form_unencode(metadata)[1][1] 49 | signature == OpenSSL::HMAC.hexdigest(digest, api_secret, data_string) 50 | end 51 | end 52 | 53 | RSpec::Matchers.define :carry_jwt_token_data do |input_data| 54 | match do |token| 55 | decoded_token = JWT.decode(token, nil, false) 56 | token_data = decoded_token.first.transform_keys {|k| k.to_sym}.transform_values {|v| v.to_s} 57 | check_token_data = lambda { |key, value| 58 | if token_data.has_key? key 59 | unless value.nil? 60 | return token_data[key] == value.to_s 61 | end 62 | return true 63 | end 64 | false 65 | } 66 | unless input_data.respond_to? :all? 67 | return check_token_data.call(input_data, nil) 68 | end 69 | input_data.all? { |k, v| check_token_data.call(k, v) } 70 | end 71 | end 72 | 73 | RSpec::Matchers.define :carry_valid_jwt_token_signature do |api_secret| 74 | match do |token| 75 | begin 76 | JWT.decode(token, api_secret, true) 77 | rescue 78 | return false 79 | end 80 | true 81 | end 82 | end 83 | -------------------------------------------------------------------------------- /spec/opentok/captions_spec.rb: -------------------------------------------------------------------------------- 1 | require "opentok/opentok" 2 | require "opentok/captions" 3 | require "opentok/version" 4 | require "spec_helper" 5 | 6 | describe OpenTok::Captions do 7 | before(:each) do 8 | now = Time.parse("2017-04-18 20:17:40 +1000") 9 | allow(Time).to receive(:now) { now } 10 | end 11 | 12 | let(:api_key) { "123456" } 13 | let(:api_secret) { "1234567890abcdef1234567890abcdef1234567890" } 14 | let(:session_id) { "SESSIONID" } 15 | let(:captions_id) { "CAPTIONSID" } 16 | let(:expiring_token) { "TOKENID" } 17 | let(:status_callback_url) { "https://example.com/captions/status" } 18 | let(:opentok) { OpenTok::OpenTok.new api_key, api_secret } 19 | let(:captions) { opentok.captions } 20 | subject { captions } 21 | 22 | it "receives a valid response when starting captions", :vcr => { :erb => { :version => OpenTok::VERSION + "-Ruby-Version-#{RUBY_VERSION}-p#{RUBY_PATCHLEVEL}"} } do 23 | response = captions.start(session_id, expiring_token) 24 | expect(response).not_to be_nil 25 | expect(response.code).to eq(202) 26 | end 27 | 28 | it "receives a valid response when starting captions with options", :vcr => { :erb => { :version => OpenTok::VERSION + "-Ruby-Version-#{RUBY_VERSION}-p#{RUBY_PATCHLEVEL}"} } do 29 | opts = { "language_code" => "en-GB", 30 | "max_duration" => 5000, 31 | "partial_captions" => false, 32 | "status_callback_url" => status_callback_url 33 | } 34 | 35 | response = captions.start(session_id, expiring_token, opts) 36 | expect(response).not_to be_nil 37 | expect(response.code).to eq(202) 38 | end 39 | 40 | it "receives a valid response when stopping captions", :vcr => { :erb => { :version => OpenTok::VERSION + "-Ruby-Version-#{RUBY_VERSION}-p#{RUBY_PATCHLEVEL}"} } do 41 | response = captions.stop(captions_id) 42 | expect(response.code).to eq(202) 43 | end 44 | end 45 | -------------------------------------------------------------------------------- /spec/opentok/client_spec.rb: -------------------------------------------------------------------------------- 1 | require "opentok/opentok" 2 | require "opentok/version" 3 | 4 | require "spec_helper" 5 | require "shared/opentok_generates_tokens" 6 | 7 | describe OpenTok::Client do 8 | before(:each) do 9 | now = Time.parse("2017-04-18 20:17:40 +1000") 10 | allow(Time).to receive(:now) { now } 11 | end 12 | 13 | let(:api_key) { "123456" } 14 | let(:api_secret) { "1234567890abcdef1234567890abcdef1234567890" } 15 | let(:api_url) { "https://api.opentok.com" } 16 | 17 | 18 | let(:client) { OpenTok::Client.new api_key, api_secret, api_url } 19 | subject { client } 20 | 21 | context "when initialized with no options" do 22 | it { should be_an_instance_of OpenTok::Client } 23 | 24 | it "should have an api_key property" do 25 | expect(client.api_key).to eq api_key 26 | end 27 | 28 | it "should have an api_secret property" do 29 | expect(client.api_secret).to eq api_secret 30 | end 31 | 32 | it "should be able to access HTTParty open_timeout method" do 33 | expect(OpenTok::Client).to respond_to(:open_timeout) 34 | end 35 | 36 | it 'should have a default timeout_length property of 2 seconds' do 37 | expect(client.timeout_length).to eq 2 38 | end 39 | end 40 | 41 | context "when initialized with timeout_length custom option" do 42 | let(:client) { OpenTok::Client.new api_key, api_secret, api_url, ua_addendum='', :timeout_length => timeout_length } 43 | let(:timeout_length) { 10 } 44 | 45 | it { should be_an_instance_of(OpenTok::Client) } 46 | 47 | it "should override timeout_length default with custom integer" do 48 | expect(client.timeout_length).to eq 10 49 | end 50 | end 51 | end -------------------------------------------------------------------------------- /spec/opentok/connection_spec.rb: -------------------------------------------------------------------------------- 1 | require "opentok/opentok" 2 | require "opentok/version" 3 | require "opentok/connections" 4 | require "spec_helper" 5 | 6 | describe OpenTok::Connections do 7 | before(:each) do 8 | now = Time.parse("2017-04-18 20:17:40 +1000") 9 | allow(Time).to receive(:now) { now } 10 | end 11 | 12 | let(:api_key) { "123456" } 13 | let(:api_secret) { "1234567890abcdef1234567890abcdef1234567890" } 14 | let(:session_id) { "SESSIONID" } 15 | let(:connection_id) { "CONNID" } 16 | let(:opentok) { OpenTok::OpenTok.new api_key, api_secret } 17 | let(:connection) { opentok.connections } 18 | 19 | subject { connection } 20 | 21 | 22 | it 'raise an error on nil session_id' do 23 | expect { 24 | connection.forceDisconnect(nil,connection_id) 25 | }.to raise_error(ArgumentError) 26 | end 27 | 28 | it 'raise an error on nil connection_id' do 29 | expect { 30 | connection.forceDisconnect(session_id,nil) 31 | }.to raise_error(ArgumentError) 32 | end 33 | 34 | it "forces a connection to be terminated", :vcr => { :erb => { :version => OpenTok::VERSION + "-Ruby-Version-#{RUBY_VERSION}-p#{RUBY_PATCHLEVEL}"} } do 35 | response = connection.forceDisconnect(session_id, connection_id) 36 | expect(response).not_to be_nil 37 | end 38 | end 39 | -------------------------------------------------------------------------------- /spec/opentok/session_spec.rb: -------------------------------------------------------------------------------- 1 | require "opentok/session" 2 | 3 | require "spec_helper" 4 | require "shared/session_generates_tokens" 5 | 6 | describe OpenTok::Session do 7 | 8 | before(:each) do 9 | now = Time.parse("2017-04-18 20:17:40 +1000") 10 | allow(Time).to receive(:now) { now } 11 | end 12 | 13 | let(:api_key) { "123456" } 14 | let(:api_secret) { "1234567890abcdef1234567890abcdef1234567890" } 15 | let(:session_id) { "SESSIONID" } 16 | 17 | let(:session) { OpenTok::Session.new api_key, api_secret, session_id } 18 | subject { session } 19 | 20 | context "when initialized with no options" do 21 | it { should be_an_instance_of OpenTok::Session } 22 | it "should have an api_key property" do 23 | expect(session.api_key).to eq api_key 24 | end 25 | it "should have an api_secret property" do 26 | expect(session.api_secret).to eq api_secret 27 | end 28 | it "should have a session_id property" do 29 | expect(session.session_id).to eq session_id 30 | end 31 | it "should be represented by session_id when coerced to a string" do 32 | expect(session.to_s).to eq session_id 33 | end 34 | it "should have the default media mode of relayed" do 35 | expect(session.media_mode).to eq :relayed 36 | end 37 | it "should not have a location value" do 38 | expect(session.location).to eq nil 39 | end 40 | include_examples "session generates tokens" 41 | end 42 | 43 | context "when initialized with options" do 44 | let(:default_opts) { {} } 45 | let(:session) { OpenTok::Session.new api_key, api_secret, session_id, default_opts } 46 | 47 | it { should be_an_instance_of OpenTok::Session } 48 | it "should have an api_key property" do 49 | expect(session.api_key).to eq api_key 50 | end 51 | it "should have an api_secret property" do 52 | expect(session.api_secret).to eq api_secret 53 | end 54 | it "should have a session_id property" do 55 | expect(session.session_id).to eq session_id 56 | end 57 | it "should be represented by session_id when coerced to a string" do 58 | expect(session.to_s).to eq session_id 59 | end 60 | it "should have media mode when set in options" do 61 | opts = { :media_mode => :routed } 62 | session = OpenTok::Session.new api_key, api_secret, session_id, opts 63 | expect(session.media_mode).to eq :routed 64 | opts = { :media_mode => :relayed } 65 | session = OpenTok::Session.new api_key, api_secret, session_id, opts 66 | expect(session.media_mode).to eq :relayed 67 | end 68 | it "should have a location value when set in options" do 69 | opts = { :location => '12.34.56.78' } 70 | session = OpenTok::Session.new api_key, api_secret, session_id, opts 71 | expect(session.location).to eq opts[:location] 72 | end 73 | include_examples "session generates tokens" 74 | end 75 | end 76 | -------------------------------------------------------------------------------- /spec/opentok/signal_spec.rb: -------------------------------------------------------------------------------- 1 | require "opentok/signals" 2 | require "opentok/opentok" 3 | require "opentok/version" 4 | require "spec_helper" 5 | 6 | describe OpenTok::Signals do 7 | before(:each) do 8 | now = Time.parse("2017-04-18 20:17:40 +1000") 9 | allow(Time).to receive(:now) { now } 10 | end 11 | 12 | let(:api_key) { "123456" } 13 | let(:api_secret) { "1234567890abcdef1234567890abcdef1234567890" } 14 | let(:session_id) { "SESSIONID" } 15 | let(:connection_id) { "CONNID" } 16 | let(:opentok) { OpenTok::OpenTok.new api_key, api_secret } 17 | let(:signal) { opentok.signals } 18 | 19 | subject { signal } 20 | 21 | it 'raise an error on nil sessionId' do 22 | expect { 23 | signal.send(nil) 24 | }.to raise_error(ArgumentError) 25 | end 26 | 27 | it 'raise an error on empty sessionId' do 28 | expect { 29 | signal.send('') 30 | }.to raise_error(ArgumentError) 31 | end 32 | 33 | it "receives a valid response for all connections", :vcr => { :erb => { :version => OpenTok::VERSION + "-Ruby-Version-#{RUBY_VERSION}-p#{RUBY_PATCHLEVEL}"} } do 34 | opts = { "type" => "chat", 35 | "data" => "Hello", 36 | } 37 | response = signal.send(session_id, "", opts) 38 | expect(response).not_to be_nil 39 | end 40 | 41 | it "receives a valid response for a connection", :vcr => { :erb => { :version => OpenTok::VERSION + "-Ruby-Version-#{RUBY_VERSION}-p#{RUBY_PATCHLEVEL}"} } do 42 | opts = { "type" => "chat", 43 | "data" => "Hello", 44 | } 45 | response = signal.send(session_id, connection_id, opts) 46 | expect(response).not_to be_nil 47 | end 48 | 49 | 50 | end -------------------------------------------------------------------------------- /spec/opentok/sip_spec.rb: -------------------------------------------------------------------------------- 1 | require "opentok/opentok" 2 | require "opentok/sip" 3 | require "opentok/version" 4 | require "spec_helper" 5 | 6 | describe OpenTok::Sip do 7 | before(:each) do 8 | now = Time.parse("2017-04-18 20:17:40 +1000") 9 | allow(Time).to receive(:now) { now } 10 | end 11 | 12 | let(:api_key) { "123456" } 13 | let(:api_secret) { "1234567890abcdef1234567890abcdef1234567890" } 14 | let(:session_id) { "SESSIONID" } 15 | let(:connection_id) { "CONNID" } 16 | let(:expiring_token) { "TOKENID" } 17 | let(:sip_uri) { "sip:+15128675309@acme.pstn.example.com;transport=tls" } 18 | let(:sip_username) { "bob" } 19 | let(:sip_password) { "abc123" } 20 | let(:opentok) { OpenTok::OpenTok.new api_key, api_secret } 21 | let(:sip) { opentok.sip } 22 | let(:valid_dtmf_digits) { "0123456789*#p" } 23 | let(:invalid_dtmf_digits) { "0123456789*#pabc" } 24 | subject { sip } 25 | 26 | it "receives a valid response", :vcr => { :erb => { :version => OpenTok::VERSION + "-Ruby-Version-#{RUBY_VERSION}-p#{RUBY_PATCHLEVEL}"} } do 27 | opts = { "auth" => { "username" => sip_username, 28 | "password" => sip_password }, 29 | "secure" => "true", 30 | "video" => "true", 31 | "observe_force_mute" => "true" 32 | } 33 | response = sip.dial(session_id, expiring_token, sip_uri, opts) 34 | expect(response).not_to be_nil 35 | end 36 | 37 | describe "#play_dtmf_to_connection" do 38 | it "raises an ArgumentError when passed an invalid dtmf digit string" do 39 | expect { 40 | sip.play_dtmf_to_connection(session_id, connection_id, invalid_dtmf_digits) 41 | }.to raise_error(ArgumentError) 42 | end 43 | 44 | it "returns a 200 response code when passed a valid dtmf digit string", :vcr => { :erb => { :version => OpenTok::VERSION + "-Ruby-Version-#{RUBY_VERSION}-p#{RUBY_PATCHLEVEL}"} } do 45 | response = sip.play_dtmf_to_connection(session_id, connection_id, valid_dtmf_digits) 46 | expect(response.code).to eq(200) 47 | end 48 | end 49 | 50 | describe "#play_dtmf_to_session" do 51 | it "raises an ArgumentError when passed an invalid dtmf digit string" do 52 | expect { 53 | sip.play_dtmf_to_session(session_id, invalid_dtmf_digits) 54 | }.to raise_error(ArgumentError) 55 | end 56 | 57 | it "returns a 200 response code when passed a valid dtmf digit string", :vcr => { :erb => { :version => OpenTok::VERSION + "-Ruby-Version-#{RUBY_VERSION}-p#{RUBY_PATCHLEVEL}"} } do 58 | response = sip.play_dtmf_to_session(session_id, valid_dtmf_digits) 59 | expect(response.code).to eq(200) 60 | end 61 | end 62 | end 63 | -------------------------------------------------------------------------------- /spec/opentok/streams_spec.rb: -------------------------------------------------------------------------------- 1 | require 'opentok/opentok' 2 | require 'opentok/version' 3 | require 'opentok/streams' 4 | require 'opentok/stream' 5 | require 'opentok/stream_list' 6 | 7 | require 'spec_helper' 8 | 9 | describe OpenTok::Streams do 10 | before(:each) do 11 | now = Time.parse('2017-04-18 20:17:40 +1000') 12 | allow(Time).to receive(:now) { now } 13 | end 14 | 15 | let(:api_key) { '123456' } 16 | let(:api_secret) { '1234567890abcdef1234567890abcdef1234567890' } 17 | let(:session_id) { 'SESSIONID' } 18 | let(:stream_id) { 'STREAMID' } 19 | let(:opentok) { OpenTok::OpenTok.new api_key, api_secret } 20 | let(:streams) { opentok.streams} 21 | 22 | subject { streams } 23 | 24 | it { should be_an_instance_of OpenTok::Streams } 25 | it 'raise an error on nil session_id' do 26 | expect { 27 | streams.all(nil) 28 | }.to raise_error(ArgumentError) 29 | end 30 | it 'raise an error on empty session_id' do 31 | expect { 32 | streams.all('') 33 | }.to raise_error(ArgumentError) 34 | end 35 | it 'get all streams information', :vcr => { :erb => { :version => OpenTok::VERSION + "-Ruby-Version-#{RUBY_VERSION}-p#{RUBY_PATCHLEVEL}"} } do 36 | all_streams = streams.all(session_id) 37 | expect(all_streams).to be_an_instance_of OpenTok::StreamList 38 | expect(all_streams.total).to eq 2 39 | expect(all_streams[0].layoutClassList[1]).to eq "focus" 40 | end 41 | it 'get specific stream information', :vcr => { :erb => { :version => OpenTok::VERSION + "-Ruby-Version-#{RUBY_VERSION}-p#{RUBY_PATCHLEVEL}"} } do 42 | stream = streams.find(session_id, stream_id) 43 | expect(stream).to be_an_instance_of OpenTok::Stream 44 | expect(stream.videoType).to eq 'camera' 45 | expect(stream.layoutClassList.count).to eq 1 46 | expect(stream.layoutClassList.first).to eq "full" 47 | expect(stream.id).not_to be_nil 48 | end 49 | it 'layout raises an error on empty session_id' do 50 | expect { 51 | streams.layout('', {} ) 52 | }.to raise_error(ArgumentError) 53 | end 54 | it 'layout raises an error on an empty stream list' do 55 | expect { 56 | streams.layout(session_id, {}) 57 | }.to raise_error(ArgumentError) 58 | end 59 | it 'layout working on two stream list', :vcr => { :erb => { :version => OpenTok::VERSION + "-Ruby-Version-#{RUBY_VERSION}-p#{RUBY_PATCHLEVEL}"} } do 60 | streams_list = { 61 | :items => [ 62 | { 63 | :id => "8b732909-0a06-46a2-8ea8-074e64d43422", 64 | :layoutClassList => ["full"] 65 | }, 66 | { 67 | :id => "8b732909-0a06-46a2-8ea8-074e64d43423", 68 | :layoutClassList => ["full", "focus"] 69 | } 70 | ] 71 | } 72 | response = streams.layout(session_id, streams_list) 73 | expect(response).not_to be_nil 74 | end 75 | 76 | it "forces the specified stream to be muted", :vcr => { :erb => { :version => OpenTok::VERSION + "-Ruby-Version-#{RUBY_VERSION}-p#{RUBY_PATCHLEVEL}"} } do 77 | response = streams.force_mute(session_id, stream_id) 78 | expect(response.code).to eq(200) 79 | end 80 | 81 | it "forces all current and future streams in a session to be muted", :vcr => { :erb => { :version => OpenTok::VERSION + "-Ruby-Version-#{RUBY_VERSION}-p#{RUBY_PATCHLEVEL}"} } do 82 | response = streams.force_mute_all(session_id) 83 | expect(response.code).to eq(200) 84 | end 85 | 86 | it "forces all current and future streams in a session to be muted except specified excluded streams", :vcr => { :erb => { :version => OpenTok::VERSION + "-Ruby-Version-#{RUBY_VERSION}-p#{RUBY_PATCHLEVEL}"} } do 87 | response = streams.force_mute_all(session_id, { "excludedStreams" => ["b1963d15-537f-459a-be89-e00fc310b82b"] }) 88 | expect(response.code).to eq(200) 89 | end 90 | 91 | it "disables the 'mute state' of a session", :vcr => { :erb => { :version => OpenTok::VERSION + "-Ruby-Version-#{RUBY_VERSION}-p#{RUBY_PATCHLEVEL}"} } do 92 | response = streams.disable_force_mute(session_id) 93 | expect(response.code).to eq(200) 94 | end 95 | end 96 | -------------------------------------------------------------------------------- /spec/opentok/websocket_spec.rb: -------------------------------------------------------------------------------- 1 | require "opentok/opentok" 2 | require "opentok/websocket" 3 | require "opentok/version" 4 | require "spec_helper" 5 | 6 | describe OpenTok::WebSocket do 7 | before(:each) do 8 | now = Time.parse("2017-04-18 20:17:40 +1000") 9 | allow(Time).to receive(:now) { now } 10 | end 11 | 12 | let(:api_key) { "123456" } 13 | let(:api_secret) { "1234567890abcdef1234567890abcdef1234567890" } 14 | let(:session_id) { "SESSIONID" } 15 | let(:connection_id) { "CONNID" } 16 | let(:expiring_token) { "TOKENID" } 17 | let(:websocket_uri) { "ws://service.com/wsendpoint" } 18 | let(:opentok) { OpenTok::OpenTok.new api_key, api_secret } 19 | let(:websocket) { opentok.websocket } 20 | subject { websocket } 21 | 22 | it "receives a valid response", :vcr => { :erb => { :version => OpenTok::VERSION + "-Ruby-Version-#{RUBY_VERSION}-p#{RUBY_PATCHLEVEL}"} } do 23 | response = websocket.connect(session_id, expiring_token, websocket_uri) 24 | expect(response).not_to be_nil 25 | end 26 | end 27 | -------------------------------------------------------------------------------- /spec/spec_helper.rb: -------------------------------------------------------------------------------- 1 | require "vcr" 2 | require 'webmock/rspec' 3 | 4 | VCR.configure do |c| 5 | c.cassette_library_dir = 'spec/cassettes' 6 | c.hook_into :webmock 7 | c.default_cassette_options = { :match_requests_on => [:method, :uri, :query, :body, :headers] } 8 | c.configure_rspec_metadata! 9 | end 10 | 11 | RSpec.configure do |c| 12 | # so we can use :vcr rather than :vcr => true; 13 | # in RSpec 3 this will no longer be necessary. 14 | c.treat_symbols_as_metadata_keys_with_true_values = true 15 | end 16 | 17 | RSpec::Expectations.configuration.on_potential_false_positives = :nothing 18 | --------------------------------------------------------------------------------