### Mux Ruby SDK Authentication Setup Source: https://github.com/muxinc/mux-ruby/blob/master/README.md Example of configuring the Mux Ruby SDK with authentication credentials read from environment variables. ```ruby #!/usr/bin/env ruby require 'mux_ruby' # Auth Setup openapi = MuxRuby.configure do |config| config.username = ENV['MUX_TOKEN_ID'] config.password = ENV['MUX_TOKEN_SECRET'] end ``` -------------------------------- ### Instantiating LaunchWebInputResponse Source: https://github.com/muxinc/mux-ruby/blob/master/docs/LaunchWebInputResponse.md Example of how to instantiate the LaunchWebInputResponse class with an optional data property. ```APIDOC ## Example Usage ### Instantiate with null data ```ruby require 'mux_ruby' instance = MuxRuby::LaunchWebInputResponse.new( data: null ) ``` ``` -------------------------------- ### Install and Configure Mux Ruby SDK Source: https://context7.com/muxinc/mux-ruby/llms.txt Install the Mux Ruby gem and configure authentication using environment variables for your Mux Token ID and Secret. ```ruby # Gemfile gem 'mux_ruby', '~> 5.1.0' # Or build and install manually: # gem build mux_ruby.gemspec # gem install ./mux_ruby-5.1.0.gem require 'mux_ruby' # Configure authentication (HTTP Basic Auth) MuxRuby.configure do |config| config.username = ENV['MUX_TOKEN_ID'] # Access Token ID config.password = ENV['MUX_TOKEN_SECRET'] # Access Token Secret end ``` -------------------------------- ### Instantiate VideoViewEvent in Ruby Source: https://github.com/muxinc/mux-ruby/blob/master/docs/VideoViewEvent.md Example of how to create a new VideoViewEvent object in Ruby. All properties are optional. ```ruby require 'mux_ruby' instance = MuxRuby::VideoViewEvent.new( viewer_time: null, playback_time: null, name: null, event_time: null, details: null ) ``` -------------------------------- ### AnnotationInput Example Source: https://github.com/muxinc/mux-ruby/blob/master/docs/AnnotationInput.md An example of how to instantiate the AnnotationInput object in Ruby. ```APIDOC ## Example ```ruby require 'mux_ruby' instance = MuxRuby::AnnotationInput.new( note: null, date: null, sub_property_id: null ) ``` ``` -------------------------------- ### Launch Web Input Source: https://github.com/muxinc/mux-ruby/blob/master/docs/WebInputsApi.md Launches a Web Input, starting the browser, loading the URL, and streaming to a Live Stream. ```APIDOC ## POST /web-inputs/{web_input_id}/launch ### Description Launches the browsers instance, loads the URL specified, and then starts streaming to the specified Live Stream. ### Method POST ### Endpoint /web-inputs/{web_input_id}/launch ### Parameters #### Path Parameters - **web_input_id** (String) - Required - The Web Input ID ### Response #### Success Response (200) - **LaunchWebInputResponse** (object) - Details of the launched Web Input ### Request Example ```ruby require 'mux_ruby' MuxRuby.configure do |config| config.username = 'YOUR USERNAME' config.password = 'YOUR PASSWORD' end api_instance = MuxRuby::WebInputsApi.new web_input_id = 'abcd1234' begin result = api_instance.launch_web_input(web_input_id) p result rescue MuxRuby::ApiError => e puts "Error when calling WebInputsApi->launch_web_input: #{e}" end ``` ### Response Example ```json { "example": "LaunchWebInputResponse" } ``` ``` -------------------------------- ### Instantiate MuxRuby InputFile Source: https://github.com/muxinc/mux-ruby/blob/master/docs/InputFile.md Example of how to create a new MuxRuby::InputFile object. Properties can be set to null if not provided. ```ruby require 'mux_ruby' instance = MuxRuby::InputFile.new( container_format: null, tracks: null ) ``` -------------------------------- ### SimulcastTargetResponse Initialization Source: https://github.com/muxinc/mux-ruby/blob/master/docs/SimulcastTargetResponse.md Example of how to initialize a SimulcastTargetResponse object in Ruby. ```APIDOC ## SimulcastTargetResponse ### Properties | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | | **data** | [**SimulcastTarget**](SimulcastTarget.md) | | [optional] | ### Example ```ruby require 'mux_ruby' instance = MuxRuby::SimulcastTargetResponse.new( data: null ) ``` ``` -------------------------------- ### MonitoringHistogramTimeseriesBucket Instantiation Source: https://github.com/muxinc/mux-ruby/blob/master/docs/MonitoringHistogramTimeseriesBucket.md Demonstrates how to create an instance of the MonitoringHistogramTimeseriesBucket with optional start and end times. ```APIDOC ## MonitoringHistogramTimeseriesBucket ### Description Represents a bucket for histogram time series data. ### Properties - **start** (Integer) - Optional. The start of the time bucket. - **_end** (Integer) - Optional. The end of the time bucket. ### Example ```ruby require 'mux_ruby' instance = MuxRuby::MonitoringHistogramTimeseriesBucket.new( start: null, _end: null ) ``` ``` -------------------------------- ### RealTimeHistogramTimeseriesBucket Initialization Source: https://github.com/muxinc/mux-ruby/blob/master/docs/RealTimeHistogramTimeseriesBucket.md Demonstrates how to initialize a RealTimeHistogramTimeseriesBucket object with optional start and end times. ```APIDOC ## RealTimeHistogramTimeseriesBucket ### Description Represents a time bucket for real-time histogram data. ### Properties #### start (Integer) - Optional #### _end (Integer) - Optional ### Example ```ruby require 'mux_ruby' instance = MuxRuby::RealTimeHistogramTimeseriesBucket.new( start: null, _end: null ) ``` ``` -------------------------------- ### Instantiate PlaybackRestriction in Ruby Source: https://github.com/muxinc/mux-ruby/blob/master/docs/PlaybackRestriction.md Demonstrates how to create a new instance of the PlaybackRestriction class in Ruby. All properties are initialized to null in this example. ```ruby require 'mux_ruby' instance = MuxRuby::PlaybackRestriction.new( id: null, created_at: null, updated_at: null, referrer: null, user_agent: null ) ``` -------------------------------- ### Launch Web Input Source: https://github.com/muxinc/mux-ruby/blob/master/docs/WebInputsApi.md Launch a Web Input. This operation starts a previously created Web Input. ```APIDOC ## PUT /video/v1/web-inputs/{WEB_INPUT_ID}/launch ### Description Launch a Web Input. ### Method PUT ### Endpoint /video/v1/web-inputs/{WEB_INPUT_ID}/launch ### Parameters #### Path Parameters - **WEB_INPUT_ID** (string) - Required - The ID of the Web Input to launch. ### Response #### Success Response (200) - **WebInputResponse** - Details of the launched Web Input. #### Response Example ```json { "example": "response body" } ``` ``` -------------------------------- ### Instantiate MonitoringHistogramTimeseriesBucket Source: https://github.com/muxinc/mux-ruby/blob/master/docs/MonitoringHistogramTimeseriesBucket.md Instantiate a MonitoringHistogramTimeseriesBucket object. The start and end properties are optional. ```ruby require 'mux_ruby' instance = MuxRuby::MonitoringHistogramTimeseriesBucket.new( start: null, _end: null ) ``` -------------------------------- ### Instantiate ListAnnotationsResponse Source: https://github.com/muxinc/mux-ruby/blob/master/docs/ListAnnotationsResponse.md This example shows how to create a new instance of the ListAnnotationsResponse class. All properties are optional and can be initialized to null. ```ruby require 'mux_ruby' instance = MuxRuby::ListAnnotationsResponse.new( data: null, total_row_count: null, timeframe: null ) ``` -------------------------------- ### Instantiate RealTimeHistogramTimeseriesBucket Source: https://github.com/muxinc/mux-ruby/blob/master/docs/RealTimeHistogramTimeseriesBucket.md Instantiate a new RealTimeHistogramTimeseriesBucket object. The start and end properties are optional. ```ruby require 'mux_ruby' instance = MuxRuby::RealTimeHistogramTimeseriesBucket.new( start: null, _end: null ) ``` -------------------------------- ### Instantiate MuxRuby Upload Source: https://github.com/muxinc/mux-ruby/blob/master/docs/Upload.md Example of how to create a new MuxRuby Upload object. All properties are optional and can be initialized to null. ```ruby require 'mux_ruby' instance = MuxRuby::Upload.new( id: null, timeout: null, status: null, new_asset_settings: null, asset_id: null, error: null, cors_origin: null, url: null, test: null ) ``` -------------------------------- ### Install Mux Ruby from Git Source: https://github.com/muxinc/mux-ruby/blob/master/README.md Instructions to add the Mux Ruby gem to your Gemfile if it's hosted in a Git repository. ```ruby gem 'mux_ruby', :git => 'https://github.com/GIT_USER_ID/GIT_REPO_ID.git' ``` -------------------------------- ### Instantiate MuxRuby::InputInfo Source: https://github.com/muxinc/mux-ruby/blob/master/docs/InputInfo.md Shows how to create a new instance of MuxRuby::InputInfo. Both settings and file properties are optional. ```ruby require 'mux_ruby' instance = MuxRuby::InputInfo.new( settings: null, file: null ) ``` -------------------------------- ### Get Real-Time Timeseries Data with Mux Ruby Source: https://github.com/muxinc/mux-ruby/blob/master/docs/RealTimeApi.md Fetches real-time timeseries data for a specified metric, including concurrent viewer counts. This endpoint is deprecated; consider using the 'Get Monitoring Timeseries' API. The `timestamp` option allows specifying the start of the data. ```ruby require 'time' require 'mux_ruby' # setup authorization MuxRuby.configure do |config| # Configure HTTP basic authorization: accessToken config.username = 'YOUR USERNAME' config.password = 'YOUR PASSWORD' end api_instance = MuxRuby::RealTimeApi.new realtime_metric_id = 'current-concurrent-viewers' # String | ID of the Realtime Metric opts = { filters: ['inner_example'], # Array | Limit the results to rows that match conditions from provided key:value pairs. Must be provided as an array query string parameter. To exclude rows that match a certain condition, prepend a `!` character to the dimension. Possible filter names are the same as returned by the List Monitoring Dimensions endpoint. Example: * `filters[]=operating_system:windows&filters[]=!country:US` timestamp: 56 # Integer | Timestamp to use as the start of the timeseries data. This value must be provided as a unix timestamp. Defaults to 30 minutes ago. } begin # Get Real-Time Timeseries result = api_instance.get_realtime_timeseries(realtime_metric_id, opts) p result rescue MuxRuby::ApiError => e puts "Error when calling RealTimeApi->get_realtime_timeseries: #{e}" end ``` -------------------------------- ### Get Monitoring Timeseries Source: https://github.com/muxinc/mux-ruby/blob/master/docs/MonitoringApi.md Retrieves timeseries data for a specific monitoring metric, including concurrent viewer counts. Supports filtering and specifying a timestamp for the start of the timeseries. ```APIDOC ## GET /monitoring/:monitoring_metric_id ### Description Gets Time series information for a specific metric along with the number of concurrent viewers. ### Method GET ### Endpoint `/monitoring/:monitoring_metric_id` ### Parameters #### Path Parameters - **monitoring_metric_id** (String) - Required - ID of the Monitoring Metric #### Query Parameters - **filters** (Array) - Optional - Limit the results to rows that match conditions from provided key:value pairs. Must be provided as an array query string parameter. To exclude rows that match a certain condition, prepend a `!` character to the dimension. Possible filter names are the same as returned by the List Monitoring Dimensions endpoint. Example: `filters[]=operating_system:windows&filters[]=!country:US` - **timestamp** (Integer) - Optional - Timestamp to use as the start of the timeseries data. This value must be provided as a unix timestamp. Defaults to 30 minutes ago. ### Response #### Success Response (200) - **response** (GetMonitoringTimeseriesResponse) - Description of the response object ### Request Example ```ruby require 'mux_ruby' MuxRuby.configure do |config| config.username = 'YOUR USERNAME' config.password = 'YOUR PASSWORD' end api_instance = MuxRuby::MonitoringApi.new monitoring_metric_id = 'current-concurrent-viewers' opts = { filters: ['inner_example'], timestamp: 56 } begin result = api_instance.get_monitoring_timeseries(monitoring_metric_id, opts) p result rescue MuxRuby::ApiError => e puts "Error when calling MonitoringApi->get_monitoring_timeseries: #{e}" end ``` ``` -------------------------------- ### Instantiate ListVideoViewExportsResponse Source: https://github.com/muxinc/mux-ruby/blob/master/docs/ListVideoViewExportsResponse.md Shows how to create a new instance of the ListVideoViewExportsResponse class. All properties are optional. ```ruby require 'mux_ruby' instance = MuxRuby::ListVideoViewExportsResponse.new( data: null, total_row_count: null, timeframe: null ) ``` -------------------------------- ### Get Real-Time Breakdown with Mux Ruby Source: https://github.com/muxinc/mux-ruby/blob/master/docs/RealTimeApi.md Fetches breakdown information for a specific real-time metric. Use this to get concurrent viewers and negative impact scores. Note: This API is deprecated; use the Get Monitoring Breakdown API instead. ```ruby require 'time' require 'mux_ruby' # setup authorization MuxRuby.configure do |config| # Configure HTTP basic authorization: accessToken config.username = 'YOUR USERNAME' config.password = 'YOUR PASSWORD' end api_instance = MuxRuby::RealTimeApi.new realtime_metric_id = 'current-concurrent-viewers' # String | ID of the Realtime Metric opts = { dimension: 'asn', # String | Dimension the specified value belongs to timestamp: 56, # Integer | Timestamp to limit results by. This value must be provided as a unix timestamp. Defaults to the current unix timestamp. filters: ['inner_example'], # Array | Limit the results to rows that match conditions from provided key:value pairs. Must be provided as an array query string parameter. To exclude rows that match a certain condition, prepend a `!` character to the dimension. Possible filter names are the same as returned by the List Monitoring Dimensions endpoint. Example: * `filters[]=operating_system:windows&filters[]=!country:US` order_by: 'negative_impact', # String | Value to order the results by order_direction: 'asc' # String | Sort order. } begin # Get Real-Time Breakdown result = api_instance.get_realtime_breakdown(realtime_metric_id, opts) p result rescue MuxRuby::ApiError => e puts "Error when calling RealTimeApi->get_realtime_breakdown: #{e}" end ``` -------------------------------- ### Launch a Web Input using WebInputsApi Source: https://github.com/muxinc/mux-ruby/blob/master/docs/WebInputsApi.md Launches a web input, starting its browser instance, loading the specified URL, and initiating streaming to a Live Stream. Requires MuxRuby to be configured with credentials. Includes error handling. ```ruby require 'time' require 'mux_ruby' # setup authorization MuxRuby.configure do |config| # Configure HTTP basic authorization: accessToken config.username = 'YOUR USERNAME' config.password = 'YOUR PASSWORD' end api_instance = MuxRuby::WebInputsApi.new web_input_id = 'abcd1234' # String | The Web Input ID begin # Launch a Web Input result = api_instance.launch_web_input(web_input_id) p result rescue MuxRuby::ApiError => e puts "Error when calling WebInputsApi->launch_web_input: #{e}" end ``` -------------------------------- ### Build and Install Mux Ruby Gem Source: https://github.com/muxinc/mux-ruby/blob/master/README.md Commands to build the Ruby gem from its source, install it locally, and add it to your Gemfile. ```shell gem build mux_ruby.gemspec gem install ./mux_ruby-5.1.0.gem ``` ```ruby gem 'mux_ruby', '~> 5.1.0' ``` -------------------------------- ### InputInfo Initialization Source: https://github.com/muxinc/mux-ruby/blob/master/docs/InputInfo.md Demonstrates how to initialize an InputInfo object with optional settings and file properties. ```APIDOC ## InputInfo ### Description Represents information about an input, which can include settings or a file. ### Properties - **settings** (InputSettings) - Optional - Configuration settings for the input. - **file** (InputFile) - Optional - Details about the input file. ### Example ```ruby require 'mux_ruby' instance = MuxRuby::InputInfo.new( settings: null, file: null ) ``` ``` -------------------------------- ### Get Real-Time Timeseries Source: https://github.com/muxinc/mux-ruby/blob/master/docs/RealTimeApi.md Retrieves timeseries information for a specific metric, including the number of concurrent viewers. This method is deprecated and users should use the `Get Monitoring Timeseries` API instead. ```APIDOC ## GET /api/v1/realtime/:realtime_metric_id ### Description Retrieves timeseries information for a specific metric, including the number of concurrent viewers. This method is deprecated and users should use the `Get Monitoring Timeseries` API instead. ### Method GET ### Endpoint /api/v1/realtime/:realtime_metric_id ### Parameters #### Path Parameters - **realtime_metric_id** (String) - Required - ID of the Realtime Metric #### Query Parameters - **filters** (Array) - Optional - Limit the results to rows that match conditions from provided key:value pairs. Must be provided as an array query string parameter. To exclude rows that match a certain condition, prepend a `!` character to the dimension. Possible filter names are the same as returned by the List Monitoring Dimensions endpoint. Example: `filters[]=operating_system:windows&filters[]=!country:US` - **timestamp** (Integer) - Optional - Timestamp to use as the start of the timeseries data. This value must be provided as a unix timestamp. Defaults to 30 minutes ago. ### Response #### Success Response (200) - **response** (GetRealTimeTimeseriesResponse) - Description of the response object ### Request Example ```ruby require 'mux_ruby' MuxRuby.configure do |config| config.username = 'YOUR USERNAME' config.password = 'YOUR PASSWORD' end api_instance = MuxRuby::RealTimeApi.new realtime_metric_id = 'current-concurrent-viewers' opts = { filters: ['inner_example'], timestamp: 56 } result = api_instance.get_realtime_timeseries(realtime_metric_id, opts) p result ``` ### Response Example ```json { "example": "response body" } ``` ``` -------------------------------- ### Get Incident with HTTP Info using Mux Ruby Source: https://github.com/muxinc/mux-ruby/blob/master/docs/IncidentsApi.md This variant returns the response data, status code, and headers for a get incident request. Useful for inspecting the full HTTP response. ```ruby begin # Get an Incident data, status_code, headers = api_instance.get_incident_with_http_info(incident_id) p status_code # => 2xx p headers # => { ... } p data # => rescue MuxRuby::ApiError => e puts "Error when calling IncidentsApi->get_incident_with_http_info: #{e}" end ``` -------------------------------- ### Instantiate ListWebInputsResponse Source: https://github.com/muxinc/mux-ruby/blob/master/docs/ListWebInputsResponse.md Demonstrates how to create a new instance of the ListWebInputsResponse class with optional data. ```ruby require 'mux_ruby' instance = MuxRuby::ListWebInputsResponse.new( data: null ) ``` -------------------------------- ### Get Annotation Source: https://github.com/muxinc/mux-ruby/blob/master/docs/AnnotationsApi.md Retrieves the details of a specific annotation by its ID. ```APIDOC ## GET /data/v1/annotations/{ANNOTATION_ID} ### Description Returns the details of a specific annotation. ### Method GET ### Endpoint /data/v1/annotations/{ANNOTATION_ID} ### Parameters #### Path Parameters - **annotation_id** (String) - Required - The ID of the annotation to retrieve. ### Response #### Success Response (200) - **AnnotationResponse** (AnnotationResponse) - The details of the requested annotation. #### Response Example ```json { "example": "response body" } ``` ``` -------------------------------- ### Instantiate ExportFile in Ruby Source: https://github.com/muxinc/mux-ruby/blob/master/docs/ExportFile.md Shows how to create a new instance of the ExportFile class. All properties are optional. ```ruby require 'mux_ruby' instance = MuxRuby::ExportFile.new( version: null, type: null, path: null ) ``` -------------------------------- ### Get Real-Time Breakdown with HTTP Info Variant Source: https://github.com/muxinc/mux-ruby/blob/master/docs/RealTimeApi.md Fetches breakdown information and includes HTTP status code and headers in the response. Use this when you need to inspect the raw HTTP response details. Note: This API is deprecated; use the Get Monitoring Breakdown API instead. ```ruby begin # Get Real-Time Breakdown data, status_code, headers = api_instance.get_realtime_breakdown_with_http_info(realtime_metric_id, opts) p status_code # => 2xx p headers # => { ... } p data # => rescue MuxRuby::ApiError => e puts "Error when calling RealTimeApi->get_realtime_breakdown_with_http_info: #{e}" end ``` -------------------------------- ### Instantiate LaunchWebInputResponse Source: https://github.com/muxinc/mux-ruby/blob/master/docs/LaunchWebInputResponse.md Instantiate the LaunchWebInputResponse object with optional data. The 'data' property can be null if no specific data is provided. ```ruby require 'mux_ruby' instance = MuxRuby::LaunchWebInputResponse.new( data: null ) ``` -------------------------------- ### Get Live Stream Source: https://github.com/muxinc/mux-ruby/blob/master/docs/LiveStreamsApi.md Retrieves the details of a specific live stream. ```APIDOC ## GET /video/v1/live-streams/{LIVE_STREAM_ID} ### Description Retrieve a live stream ### Method GET ### Endpoint /video/v1/live-streams/{LIVE_STREAM_ID} ### Parameters #### Path Parameters - **LIVE_STREAM_ID** (string) - Required - The ID of the live stream to retrieve. ### Response #### Success Response (200) - **id** (string) - Unique identifier for the live stream. - **stream_key** (string) - The stream key for the live stream. - **playback_ids** (array) - An array of playback IDs associated with the live stream. - **object** (string) - Type of object returned, should be "live_stream". - **created_at** (string) - Timestamp of when the live stream was created. - **updated_at** (string) - Timestamp of when the live stream was last updated. - **status** (string) - Current status of the live stream (e.g., "idle", "active", "errored"). - **reconnect_window** (integer) - The time in seconds an encoder has to reconnect before the stream is considered disconnected. - **new_asset_settings** (object) - Settings for new assets created from this live stream. - **passthrough** (string) - Arbitrary data you can pass to the API to identify the stream. - **latency_mode** (string) - The latency mode for the live stream. - **reduced_latency_control** (string) - Control for reduced latency. - **disconnect_wait_time** (integer) - The time in seconds to wait before considering the stream disconnected. - **max_continuous_duration** (integer) - The maximum continuous duration of the live stream in seconds. - **auto_close_after_seconds** (integer) - The number of seconds after which the live stream will be automatically closed. - **exclude_from_analytics** (boolean) - Whether to exclude this live stream from analytics. - **simulcast_targets** (array) - An array of simulcast targets configured for the live stream. - **last_ப்பட்டது_at** (string) - Timestamp of when the live stream was last active. - **last_seen_at** (string) - Timestamp of when the live stream was last seen. - **last_disconnected_at** (string) - Timestamp of when the live stream was last disconnected. - **last_reconnected_at** (string) - Timestamp of when the live stream was last reconnected. - **last_completed_at** (string) - Timestamp of when the live stream was last completed. - **last_idle_at** (string) - Timestamp of when the live stream was last idle. - **last_active_at** (string) - Timestamp of when the live stream was last active. - **last_errored_at** (string) - Timestamp of when the live stream last errored. - **last_disabled_at** (string) - Timestamp of when the live stream was last disabled. - **last_enabled_at** (string) - Timestamp of when the live stream was last enabled. - **last_reset_stream_key_at** (string) - Timestamp of when the live stream's stream key was last reset. - **last_signal_complete_at** (string) - Timestamp of when the live stream was last signaled as complete. - **last_update_at** (string) - Timestamp of when the live stream was last updated. - **last_embedded_subtitles_update_at** (string) - Timestamp of when the live stream's embedded subtitles were last updated. - **last_generated_subtitles_update_at** (string) - Timestamp of when the live stream's generated subtitles were last updated. - **last_new_asset_settings_static_renditions_update_at** (string) - Timestamp of when the live stream's static renditions for new assets were last updated. #### Response Example ```json { "id": "some_live_stream_id", "stream_key": "some_stream_key", "playback_ids": [ { "id": "some_playback_id", "policy": "some_policy" } ], "object": "live_stream", "created_at": "2023-10-27T10:00:00Z", "updated_at": "2023-10-27T10:05:00Z", "status": "idle", "reconnect_window": 60, "new_asset_settings": {}, "passthrough": "user-defined-id", "latency_mode": "low", "reduced_latency_control": "auto", "disconnect_wait_time": 15, "max_continuous_duration": 7200, "auto_close_after_seconds": 3600, "exclude_from_analytics": false, "simulcast_targets": [], "last_ப்பட்டது_at": null, "last_seen_at": null, "last_disconnected_at": null, "last_reconnected_at": null, "last_completed_at": null, "last_idle_at": "2023-10-27T10:05:00Z", "last_active_at": null, "last_errored_at": null, "last_disabled_at": null, "last_enabled_at": null, "last_reset_stream_key_at": null, "last_signal_complete_at": null, "last_update_at": "2023-10-27T10:05:00Z", "last_embedded_subtitles_update_at": null, "last_generated_subtitles_update_at": null, "last_new_asset_settings_static_renditions_update_at": null } ``` ``` -------------------------------- ### InputSettingsOverlaySettings Initialization Source: https://github.com/muxinc/mux-ruby/blob/master/docs/InputSettingsOverlaySettings.md Demonstrates how to initialize the InputSettingsOverlaySettings object with various properties. ```APIDOC ## Class: MuxRuby::InputSettingsOverlaySettings ### Description Represents the settings for configuring overlay and watermark properties. ### Properties #### vertical_align - **Type**: String - **Description**: Where the vertical positioning of the overlay/watermark should begin from. Defaults to `"top"`. - **Notes**: [optional] #### vertical_margin - **Type**: String - **Description**: The distance from the vertical_align starting point and the image's closest edge. Can be expressed as a percent (`"10%"`) or as a pixel value (`"100px"`). Negative values will move the overlay offscreen. In the case of 'middle', a positive value will shift the overlay towards the bottom and and a negative value will shift it towards the top. - **Notes**: [optional] #### horizontal_align - **Type**: String - **Description**: Where the horizontal positioning of the overlay/watermark should begin from. - **Notes**: [optional] #### horizontal_margin - **Type**: String - **Description**: The distance from the horizontal_align starting point and the image's closest edge. Can be expressed as a percent (`"10%"`) or as a pixel value (`"100px"`). Negative values will move the overlay offscreen. In the case of 'center', a positive value will shift the image towards the right and and a negative value will shift it towards the left. - **Notes**: [optional] #### width - **Type**: String - **Description**: How wide the overlay should appear. Can be expressed as a percent (`"10%"`) or as a pixel value (`"100px"`). If both width and height are left blank the width will be the true pixels of the image, applied as if the video has been scaled to fit a 1920x1080 frame. If height is supplied with no width, the width will scale proportionally to the height. - **Notes**: [optional] #### height - **Type**: String - **Description**: How tall the overlay should appear. Can be expressed as a percent (`"10%"`) or as a pixel value (`"100px"`). If both width and height are left blank the height will be the true pixels of the image, applied as if the video has been scaled to fit a 1920x1080 frame. If width is supplied with no height, the height will scale proportionally to the width. - **Notes**: [optional] #### opacity - **Type**: String - **Description**: How opaque the overlay should appear, expressed as a percent. (Default 100%) - **Notes**: [optional] ### Example ```ruby require 'mux_ruby' instance = MuxRuby::InputSettingsOverlaySettings.new( vertical_align: null, vertical_margin: null, horizontal_align: null, horizontal_margin: null, width: null, height: null, opacity: null ) ``` ``` -------------------------------- ### Initialize InputSettingsOverlaySettings Source: https://github.com/muxinc/mux-ruby/blob/master/docs/InputSettingsOverlaySettings.md Instantiate MuxRuby::InputSettingsOverlaySettings with optional properties. All properties are optional and will default to null if not provided. ```ruby require 'mux_ruby' instance = MuxRuby::InputSettingsOverlaySettings.new( vertical_align: null, vertical_margin: null, horizontal_align: null, horizontal_margin: null, width: null, height: null, opacity: null ) ``` -------------------------------- ### Get Real-Time Timeseries Source: https://github.com/muxinc/mux-ruby/blob/master/docs/RealTimeApi.md Retrieves timeseries information for a specific metric. ```APIDOC ## GET /data/v1/realtime/metrics/{REALTIME_METRIC_ID}/timeseries ### Description Retrieves timeseries information for a specific metric. ### Method GET ### Endpoint /data/v1/realtime/metrics/{REALTIME_METRIC_ID}/timeseries ### Parameters #### Path Parameters - **realtime_metric_id** (String) - Required - ID of the Realtime Metric ### Response #### Success Response (200) - **GetRealTimeTimeseriesResponse** - The response object containing timeseries data. ``` -------------------------------- ### InputTrack Initialization Source: https://github.com/muxinc/mux-ruby/blob/master/docs/InputTrack.md Demonstrates how to initialize an InputTrack object with its properties. ```APIDOC ## InputTrack ### Description Represents an input track within Mux, detailing its properties such as type, duration, encoding, and technical specifications. ### Properties #### type - **String** - Optional - The type of the input track (e.g., 'video', 'audio'). #### duration - **Float** - Optional - The duration of the input track in seconds. #### encoding - **String** - Optional - The encoding format of the input track (e.g., 'h264', 'aac'). #### width - **Integer** - Optional - The width of the video track in pixels. #### height - **Integer** - Optional - The height of the video track in pixels. #### frame_rate - **Float** - Optional - The frame rate of the video track in frames per second. #### sample_rate - **Integer** - Optional - The audio sample rate in Hz. #### sample_size - **Integer** - Optional - The audio sample size in bits. #### channels - **Integer** - Optional - The number of audio channels. ### Example ```ruby require 'mux_ruby' instance = MuxRuby::InputTrack.new( type: null, duration: null, encoding: null, width: null, height: null, frame_rate: null, sample_rate: null, sample_size: null, channels: null ) ``` ``` -------------------------------- ### Get Transcription Vocabulary Source: https://github.com/muxinc/mux-ruby/blob/master/docs/TranscriptionVocabulariesApi.md Retrieves a specific Transcription Vocabulary by its ID. ```APIDOC ## GET /video/v1/transcription-vocabularies/{TRANSCRIPTION_VOCABULARY_ID} ### Description Retrieve a Transcription Vocabulary. ### Method GET ### Endpoint /video/v1/transcription-vocabularies/{TRANSCRIPTION_VOCABULARY_ID} ### Parameters #### Path Parameters - **TRANSCRIPTION_VOCABULARY_ID** (string) - Required - The ID of the Transcription Vocabulary. ### Response #### Success Response (200) - **id** (string) - The unique identifier for the transcription vocabulary. - **name** (string) - The name of the transcription vocabulary. - **phrases** (array[string]) - An array of phrases to be included in the vocabulary. - **created_at** (string) - The timestamp when the vocabulary was created. - **updated_at** (string) - The timestamp when the vocabulary was last updated. #### Response Example ```json { "id": "example_id", "name": "example_name", "phrases": ["example phrase 1", "example phrase 2"], "created_at": "2023-10-27T10:00:00Z", "updated_at": "2023-10-27T10:00:00Z" } ``` ### Error Handling - **404 Not Found**: If the specified Transcription Vocabulary ID does not exist. ``` -------------------------------- ### Instantiate RealTimeTimeseriesDatapoint Source: https://github.com/muxinc/mux-ruby/blob/master/docs/RealTimeTimeseriesDatapoint.md Shows how to create a new instance of RealTimeTimeseriesDatapoint. All properties are optional. ```ruby require 'mux_ruby' instance = MuxRuby::RealTimeTimeseriesDatapoint.new( value: null, date: null, concurrent_viewers: null ) ``` -------------------------------- ### Get an Incident Source: https://github.com/muxinc/mux-ruby/blob/master/docs/IncidentsApi.md Retrieves the details of a specific incident using its ID. ```APIDOC ## GET /data/v1/incidents/{INCIDENT_ID} ### Description Get an Incident Returns the details of an incident. ### Method GET ### Endpoint /data/v1/incidents/{INCIDENT_ID} ### Parameters #### Path Parameters - **incident_id** (String) - Required - ID of the Incident ### Response #### Success Response (200) - **IncidentResponse** - Details of the incident. ### Request Example ```ruby require 'mux_ruby' MuxRuby.configure do |config| config.username = 'YOUR USERNAME' config.password = 'YOUR PASSWORD' end api_instance = MuxRuby::IncidentsApi.new incident_id = 'abcd1234' begin result = api_instance.get_incident(incident_id) p result rescue MuxRuby::ApiError => e puts "Error when calling IncidentsApi->get_incident: #{e}" end ``` ``` -------------------------------- ### Initialize ListSigningKeysResponse Source: https://github.com/muxinc/mux-ruby/blob/master/docs/ListSigningKeysResponse.md Instantiate a ListSigningKeysResponse object. The 'data' property is optional. ```ruby require 'mux_ruby' instance = MuxRuby::ListSigningKeysResponse.new( data: null ) ``` -------------------------------- ### Get Playback Restriction Source: https://github.com/muxinc/mux-ruby/blob/master/docs/PlaybackRestrictionsApi.md Retrieves the details of a specific playback restriction by its ID. ```APIDOC ## GET /video/v1/playback-restrictions/{PLAYBACK_RESTRICTION_ID} ### Description Retrieve a Playback Restriction. ### Method GET ### Endpoint /video/v1/playback-restrictions/{PLAYBACK_RESTRICTION_ID} ### Parameters #### Path Parameters - **playback_restriction_id** (String) - Required - ID of the Playback Restriction. ### Request Example ```ruby require 'time' require 'mux_ruby' MuxRuby.configure do |config| config.username = 'YOUR USERNAME' config.password = 'YOUR PASSWORD' end api_instance = MuxRuby::PlaybackRestrictionsApi.new playback_restriction_id = 'playback_restriction_id_example' begin result = api_instance.get_playback_restriction(playback_restriction_id) p result rescue MuxRuby::ApiError => e puts "Error when calling PlaybackRestrictionsApi->get_playback_restriction: #{e}" end ``` ### Response #### Success Response (200) - **PlaybackRestrictionResponse** (PlaybackRestrictionResponse) - Description of the response body #### Response Example ```json { "example": "response body" } ``` ``` -------------------------------- ### Initialize Input Settings - Mux Ruby Source: https://github.com/muxinc/mux-ruby/blob/master/docs/InputSettings.md Instantiate the InputSettings object with various optional parameters. All parameters are optional and can be set to null if not needed. ```ruby require 'mux_ruby' instance = MuxRuby::InputSettings.new( url: null, overlay_settings: null, generated_subtitles: null, start_time: null, end_time: null, type: null, text_type: null, language_code: null, name: null, closed_captions: null, passthrough: null ) ``` -------------------------------- ### UpdateLiveStreamRequest Initialization Source: https://github.com/muxinc/mux-ruby/blob/master/docs/UpdateLiveStreamRequest.md This example demonstrates how to initialize an UpdateLiveStreamRequest object with various optional parameters. ```APIDOC ## UpdateLiveStreamRequest ### Properties | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | | **passthrough** | **String** | Arbitrary user-supplied metadata set for the live stream. Max 255 characters. In order to clear this value, the field should be included with an empty-string value. | [optional] | | **latency_mode** | **String** | Latency is the time from when the streamer transmits a frame of video to when you see it in the player. Set this as an alternative to setting low latency or reduced latency flags. | [optional] | | **reconnect_window** | **Float** | When live streaming software disconnects from Mux, either intentionally or due to a drop in the network, the Reconnect Window is the time in seconds that Mux should wait for the streaming software to reconnect before considering the live stream finished and completing the recorded asset. If not specified directly, Standard Latency streams have a Reconnect Window of 60 seconds; Reduced and Low Latency streams have a default of 0 seconds, or no Reconnect Window. For that reason, we suggest specifying a value other than zero for Reduced and Low Latency streams. Reduced and Low Latency streams with a Reconnect Window greater than zero will insert slate media into the recorded asset while waiting for the streaming software to reconnect or when there are brief interruptions in the live stream media. When using a Reconnect Window setting higher than 60 seconds with a Standard Latency stream, we highly recommend enabling slate with the `use_slate_for_standard_latency` option. | [optional][default to 60] | | **use_slate_for_standard_latency** | **Boolean** | By default, Standard Latency live streams do not have slate media inserted while waiting for live streaming software to reconnect to Mux. Setting this to true enables slate insertion on a Standard Latency stream. | [optional][default to false] | | **reconnect_slate_url** | **String** | The URL of the image file that Mux should download and use as slate media during interruptions of the live stream media. This file will be downloaded each time a new recorded asset is created from the live stream. Set this to a blank string to clear the value so that the default slate media will be used. | [optional] | | **max_continuous_duration** | **Integer** | The time in seconds a live stream may be continuously active before being disconnected. Defaults to 12 hours. | [optional][default to 43200] | | **new_asset_settings** | [**UpdateLiveStreamNewAssetSettings**](UpdateLiveStreamNewAssetSettings.md) | | [optional] | | **meta** | [**LiveStreamMetadata**](LiveStreamMetadata.md) | | [optional] | ### Example ```ruby require 'mux_ruby' instance = MuxRuby::UpdateLiveStreamRequest.new( passthrough: null, latency_mode: null, reconnect_window: null, use_slate_for_standard_latency: null, reconnect_slate_url: null, max_continuous_duration: null, new_asset_settings: null, meta: null ) ``` ``` -------------------------------- ### Get Overall Values Source: https://github.com/muxinc/mux-ruby/blob/master/docs/MetricsApi.md Retrieves overall values for a specific metric across all dimensions. ```APIDOC ## GET /data/v1/metrics/{METRIC_ID}/overall ### Description Get Overall values. Returns overall values for a specific metric. ### Method GET ### Endpoint /data/v1/metrics/{METRIC_ID}/overall ### Parameters #### Path Parameters - **METRIC_ID** (string) - Required - The ID of the metric to retrieve overall values for. #### Query Parameters - **filters** (string) - Optional - Filters to apply to the overall values. - **region** (string) - Optional - The region to filter the data by. - **measurement** (string) - Optional - The measurement to use for the metric (e.g., 'average', 'sum', 'count'). - **start_time** (string) - Optional - The start time for the data range. - **end_time** (string) - Optional - The end time for the data range. ### Request Example ```ruby require 'mux_ruby' api_client = MuxRuby.new begin resp = api_client.metrics_api.get_overall_values( 'METRIC_ID', { 'filters': ['country:US'], 'region': 'us-east-1', 'measurement': 'average', 'start_time': Time.now.utc.iso8601, 'end_time': (Time.now.utc + 3600).iso8601 } ) @response_content = resp.data @response_headers = resp.headers escue MuxRuby::ApiError => e # Handle API errors end ``` ### Response #### Success Response (200) - **data** (object) - An object containing the overall metric values. - **value** (number) - The overall calculated metric value. - **views** (integer) - The total number of views. #### Response Example ```json { "data": { "value": 101.5, "views": 10100 }, "total_quality_scores": { "ok": 10000, "good": 500, "poor": 50 }, "timeframe": [ "2023-10-26T00:00:00Z", "2023-10-27T00:00:00Z" ] } ``` ``` -------------------------------- ### Instantiate ListAllMetricValuesResponse Source: https://github.com/muxinc/mux-ruby/blob/master/docs/ListAllMetricValuesResponse.md Demonstrates how to create a new instance of the ListAllMetricValuesResponse object with null values for its properties. ```ruby require 'mux_ruby' instance = MuxRuby::ListAllMetricValuesResponse.new( data: null, total_row_count: null, timeframe: null ) ``` -------------------------------- ### Get Web Input Source: https://github.com/muxinc/mux-ruby/blob/master/docs/WebInputsApi.md Retrieves the details of a specific Web Input using its ID. ```APIDOC ## GET /web-inputs/{web_input_id} ### Description Retrieves the details of a specific Web Input. ### Method GET ### Endpoint /web-inputs/{web_input_id} ### Parameters #### Path Parameters - **web_input_id** (String) - Required - The Web Input ID ### Response #### Success Response (200) - **WebInputResponse** (object) - Details of the Web Input ### Request Example ```ruby require 'mux_ruby' MuxRuby.configure do |config| config.username = 'YOUR USERNAME' config.password = 'YOUR PASSWORD' end api_instance = MuxRuby::WebInputsApi.new web_input_id = 'abcd1234' begin result = api_instance.get_web_input(web_input_id) p result rescue MuxRuby::ApiError => e puts "Error when calling WebInputsApi->get_web_input: #{e}" end ``` ### Response Example ```json { "example": "WebInputResponse" } ``` ``` -------------------------------- ### Get Video View Source: https://github.com/muxinc/mux-ruby/blob/master/docs/VideoViewsApi.md Retrieves the details of a specific video view using its ID. ```APIDOC ## GET /data/v1/video-views/{VIDEO_VIEW_ID} ### Description Get a Video View Returns the details of a video view. ### Method GET ### Endpoint /data/v1/video-views/{VIDEO_VIEW_ID} ### Parameters #### Path Parameters - **VIDEO_VIEW_ID** (String) - Required - The ID of the Video View. ### Response #### Success Response (200) - **VideoViewResponse** - Details of the video view. ### Request Example ```ruby require 'time' require 'mux_ruby' MuxRuby.configure do |config| config.username = 'YOUR USERNAME' config.password = 'YOUR PASSWORD' end api_instance = MuxRuby::VideoViewsApi.new video_view_id = 'abcd1234' begin result = api_instance.get_video_view(video_view_id) p result rescue MuxRuby::ApiError => e puts "Error when calling VideoViewsApi->get_video_view: #{e}" end ``` ```