Sha256: 7003379a655c2ce0e15b7f6396cc21b64a7277e85dcb019af28814cadde60a92

Contents?: true

Size: 848 Bytes

Versions: 39

Compression:

Stored size: 848 Bytes

Contents

#!/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

# API Client Init
live_api = MuxRuby::LiveStreamsApi.new

# Create the Live Stream
create_asset_request = MuxRuby::CreateAssetRequest.new
create_asset_request.playback_policy = [MuxRuby::PlaybackPolicy::PUBLIC]
create_live_stream_request = MuxRuby::CreateLiveStreamRequest.new
create_live_stream_request.new_asset_settings = create_asset_request
create_live_stream_request.playback_policy = [MuxRuby::PlaybackPolicy::PUBLIC]
stream = live_api.create_live_stream(create_live_stream_request)

# Give back the RTMP entry point playback endpoint
puts "New Live Stream created!"
puts "RTMP Endpoint: rtmp://live.mux.com/app"
puts "Stream Key: #{stream.data.stream_key}"

Version data entries

39 entries across 39 versions & 1 rubygems

Version Path
mux_ruby-3.20.0 examples/video/create-live-stream.rb
mux_ruby-3.19.0 examples/video/create-live-stream.rb
mux_ruby-3.18.0 examples/video/create-live-stream.rb
mux_ruby-3.17.0 examples/video/create-live-stream.rb
mux_ruby-3.15.0 examples/video/create-live-stream.rb
mux_ruby-3.14.0 examples/video/create-live-stream.rb
mux_ruby-3.13.0 examples/video/create-live-stream.rb
mux_ruby-3.12.0 examples/video/create-live-stream.rb
mux_ruby-3.11.1 examples/video/create-live-stream.rb
mux_ruby-3.11.0 examples/video/create-live-stream.rb
mux_ruby-3.9.0 examples/video/create-live-stream.rb
mux_ruby-3.8.0 examples/video/create-live-stream.rb
mux_ruby-3.7.0 examples/video/create-live-stream.rb
mux_ruby-3.6.0 examples/video/create-live-stream.rb
mux_ruby-3.5.2 examples/video/create-live-stream.rb
mux_ruby-3.5.1 examples/video/create-live-stream.rb
mux_ruby-3.5.0 examples/video/create-live-stream.rb
mux_ruby-3.4.0 examples/video/create-live-stream.rb
mux_ruby-3.3.1 examples/video/create-live-stream.rb
mux_ruby-3.3.0 examples/video/create-live-stream.rb