Class: Vonage::Video::Captions

Inherits:
Namespace
  • Object
show all
Defined in:
lib/vonage/video/captions.rb

Instance Method Summary collapse

Instance Method Details

#start(session_id:, token:, **params) ⇒ Response

Start Live Captions for a Vonage Video stream

Examples:

response = client.video.captions.start(
  session_id: "12312312-3811-4726-b508-e41a0f96c68f",
  token: "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJp...",
  language_code: 'en-US',
  max_duration: 300,
  partial_captions: false,
  status_callback_url: 'https://example.com/captions/status'
)

See Also:

  • Add document link here


45
46
47
48
49
50
# File 'lib/vonage/video/captions.rb', line 45

def start(session_id:, token:, **params)
  request(
    '/v2/project/' + @config.application_id + '/captions',
    params: camelcase(params.merge({sessionId: session_id, token: token})),
    type: Post)
end

#stop(captions_id:) ⇒ Response

Stop live captions for a session

Examples:

response = client.video.captions.stop(captions_id: "7c0580fc-6274-4de5-a66f-d0648e8d3ac3")

See Also:

  • Add document link here


63
64
65
# File 'lib/vonage/video/captions.rb', line 63

def stop(captions_id:)
  request('/v2/project/' + @config.application_id + '/captions/' + captions_id + '/stop', type: Post)
end