wsc_sdk 1.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.circleci/config.yml +146 -0
- data/.circleci/docker/build/Dockerfile +3 -0
- data/.circleci/helpers/add_preamble.rb +29 -0
- data/.circleci/helpers/build_docs.sh +5 -0
- data/.circleci/helpers/build_gem.sh +5 -0
- data/.circleci/helpers/debundle-context.sh +14 -0
- data/.circleci/helpers/finalize_release.sh +24 -0
- data/.circleci/helpers/publish_docs.sh +10 -0
- data/.circleci/helpers/release_gem.sh +8 -0
- data/.circleci/helpers/setup.sh +11 -0
- data/.circleci/helpers/setup_aws.sh +13 -0
- data/.circleci/helpers/setup_gem.sh +2 -0
- data/.circleci/helpers/setup_git.sh +27 -0
- data/.circleci/helpers/setup_rubygems.sh +15 -0
- data/.circleci/helpers/test_integration.sh +12 -0
- data/.circleci/helpers/test_unit.sh +6 -0
- data/.circleci/jobs/publish-production.sh +17 -0
- data/.circleci/jobs/publish-staging.sh +17 -0
- data/.circleci/jobs/release-production.sh +21 -0
- data/.circleci/jobs/test-integration.sh +9 -0
- data/.circleci/jobs/test-unit.sh +9 -0
- data/.circleci/tag_repo.rb +46 -0
- data/.gitignore +28 -0
- data/.rspec +2 -0
- data/.yard/config +2 -0
- data/.yard/template/default/fulldoc/html/css/custom.css +151 -0
- data/.yard/template/default/layout/html/footer.erb +0 -0
- data/.yard/template/default/layout/html/headers.erb +10 -0
- data/.yard/template/default/layout/html/layout.erb +45 -0
- data/.yard/template/default/layout/html/setup.rb +24 -0
- data/.yardopts +1 -0
- data/CODE_OF_CONDUCT.md +74 -0
- data/Gemfile +6 -0
- data/Gemfile.lock +99 -0
- data/LICENSE.txt +28 -0
- data/README.md +397 -0
- data/Rakefile +2 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/doc/Hash.html +291 -0
- data/doc/WscSdk.html +570 -0
- data/doc/WscSdk/ApiResponse.html +242 -0
- data/doc/WscSdk/Attributes.html +128 -0
- data/doc/WscSdk/Attributes/Mode.html +191 -0
- data/doc/WscSdk/Attributes/Type.html +389 -0
- data/doc/WscSdk/Client.html +2677 -0
- data/doc/WscSdk/Configuration.html +595 -0
- data/doc/WscSdk/Endpoint.html +2974 -0
- data/doc/WscSdk/Endpoints.html +141 -0
- data/doc/WscSdk/Endpoints/CustomStreamTargets.html +383 -0
- data/doc/WscSdk/Endpoints/LiveStreams.html +197 -0
- data/doc/WscSdk/Endpoints/OutputStreamTargets.html +180 -0
- data/doc/WscSdk/Endpoints/Outputs.html +180 -0
- data/doc/WscSdk/Endpoints/StreamTargets.html +446 -0
- data/doc/WscSdk/Endpoints/Transcoders.html +197 -0
- data/doc/WscSdk/Endpoints/UllStreamTargets.html +383 -0
- data/doc/WscSdk/Endpoints/WowzaStreamTargets.html +383 -0
- data/doc/WscSdk/Enum.html +225 -0
- data/doc/WscSdk/Enums.html +321 -0
- data/doc/WscSdk/Enums/BillingMode.html +188 -0
- data/doc/WscSdk/Enums/BroadcastLocation.html +396 -0
- data/doc/WscSdk/Enums/BufferSize.html +301 -0
- data/doc/WscSdk/Enums/ClosedCaptionType.html +221 -0
- data/doc/WscSdk/Enums/CustomProvider.html +252 -0
- data/doc/WscSdk/Enums/DeliveryMethod.html +188 -0
- data/doc/WscSdk/Enums/DeliveryType.html +188 -0
- data/doc/WscSdk/Enums/Encoder.html +460 -0
- data/doc/WscSdk/Enums/Errors.html +555 -0
- data/doc/WscSdk/Enums/IdleTimeout.html +398 -0
- data/doc/WscSdk/Enums/ImagePosition.html +220 -0
- data/doc/WscSdk/Enums/ModelMode.html +175 -0
- data/doc/WscSdk/Enums/ModelType.html +373 -0
- data/doc/WscSdk/Enums/PlayerType.html +188 -0
- data/doc/WscSdk/Enums/Protocol.html +204 -0
- data/doc/WscSdk/Enums/TargetDeliveryProtocol.html +188 -0
- data/doc/WscSdk/Enums/TranscoderType.html +188 -0
- data/doc/WscSdk/Enums/UserRegion.html +383 -0
- data/doc/WscSdk/Enums/WowzaProvider.html +188 -0
- data/doc/WscSdk/Errors.html +683 -0
- data/doc/WscSdk/Loggable.html +346 -0
- data/doc/WscSdk/Model.html +3316 -0
- data/doc/WscSdk/ModelList.html +442 -0
- data/doc/WscSdk/ModelTemplate.html +267 -0
- data/doc/WscSdk/Models.html +141 -0
- data/doc/WscSdk/Models/CustomStreamTarget.html +192 -0
- data/doc/WscSdk/Models/Error.html +351 -0
- data/doc/WscSdk/Models/LiveStream.html +601 -0
- data/doc/WscSdk/Models/LiveStreamConnectionCode.html +192 -0
- data/doc/WscSdk/Models/LiveStreamState.html +200 -0
- data/doc/WscSdk/Models/LiveStreamStats.html +200 -0
- data/doc/WscSdk/Models/LiveStreamThumbnailUrl.html +200 -0
- data/doc/WscSdk/Models/Output.html +294 -0
- data/doc/WscSdk/Models/OutputStreamTarget.html +274 -0
- data/doc/WscSdk/Models/StreamTarget.html +273 -0
- data/doc/WscSdk/Models/Transcoder.html +793 -0
- data/doc/WscSdk/Models/TranscoderBooleanStat.html +278 -0
- data/doc/WscSdk/Models/TranscoderConnectionCode.html +192 -0
- data/doc/WscSdk/Models/TranscoderFloatStat.html +278 -0
- data/doc/WscSdk/Models/TranscoderIntegerStat.html +278 -0
- data/doc/WscSdk/Models/TranscoderState.html +196 -0
- data/doc/WscSdk/Models/TranscoderStats.html +196 -0
- data/doc/WscSdk/Models/TranscoderStreamTargetState.html +192 -0
- data/doc/WscSdk/Models/TranscoderStringStat.html +278 -0
- data/doc/WscSdk/Models/TranscoderThumbnailUrl.html +196 -0
- data/doc/WscSdk/Models/UllStreamTarget.html +360 -0
- data/doc/WscSdk/Models/WowzaStreamTarget.html +380 -0
- data/doc/WscSdk/Pagination.html +1277 -0
- data/doc/WscSdk/Schema.html +861 -0
- data/doc/WscSdk/SchemaAttribute.html +2400 -0
- data/doc/WscSdk/Templates.html +141 -0
- data/doc/WscSdk/Templates/CustomStreamTarget.html +1045 -0
- data/doc/WscSdk/Templates/LiveStream.html +1432 -0
- data/doc/WscSdk/Templates/Output.html +829 -0
- data/doc/WscSdk/Templates/Transcoder.html +699 -0
- data/doc/WscSdk/Templates/UllStreamTarget.html +411 -0
- data/doc/WscSdk/Templates/WowzaStreamTarget.html +447 -0
- data/doc/WscSdk/TranscoderSharedMethods.html +1113 -0
- data/doc/_index.html +705 -0
- data/doc/class_list.html +51 -0
- data/doc/css/bootstrap.css +5 -0
- data/doc/css/common.css +1 -0
- data/doc/css/custom.css +151 -0
- data/doc/css/full_list.css +58 -0
- data/doc/css/style.css +496 -0
- data/doc/file.README.html +570 -0
- data/doc/file_list.html +56 -0
- data/doc/frames.html +17 -0
- data/doc/images/wsc-ruby-1800x400.png +0 -0
- data/doc/index.html +570 -0
- data/doc/js/app.js +292 -0
- data/doc/js/full_list.js +216 -0
- data/doc/js/jquery.js +4 -0
- data/doc/method_list.html +1731 -0
- data/doc/top-level-namespace.html +182 -0
- data/examples/client.rb +40 -0
- data/examples/helpers.rb +100 -0
- data/examples/live_streams/create.rb +39 -0
- data/examples/live_streams/delete.rb +32 -0
- data/examples/live_streams/find.rb +22 -0
- data/examples/live_streams/flood.rb +126 -0
- data/examples/live_streams/list.rb +24 -0
- data/examples/live_streams/regenerate_connection_code.rb +29 -0
- data/examples/live_streams/reset.rb +32 -0
- data/examples/live_streams/reset_and_wait.rb +51 -0
- data/examples/live_streams/start.rb +33 -0
- data/examples/live_streams/start_and_wait.rb +51 -0
- data/examples/live_streams/state.rb +33 -0
- data/examples/live_streams/stats.rb +43 -0
- data/examples/live_streams/stop.rb +33 -0
- data/examples/live_streams/stop_and_wait.rb +51 -0
- data/examples/live_streams/thumbnail_url.rb +46 -0
- data/examples/live_streams/update.rb +43 -0
- data/examples/live_streams/workflow.rb +165 -0
- data/examples/output_stream_targets/create.rb +56 -0
- data/examples/output_stream_targets/delete.rb +45 -0
- data/examples/output_stream_targets/find.rb +37 -0
- data/examples/output_stream_targets/list.rb +36 -0
- data/examples/output_stream_targets/update.rb +56 -0
- data/examples/outputs/create.rb +49 -0
- data/examples/outputs/delete.rb +39 -0
- data/examples/outputs/find.rb +31 -0
- data/examples/outputs/list.rb +29 -0
- data/examples/outputs/update.rb +50 -0
- data/examples/stream_targets/custom/create.rb +42 -0
- data/examples/stream_targets/custom/delete.rb +31 -0
- data/examples/stream_targets/custom/find.rb +23 -0
- data/examples/stream_targets/custom/list.rb +24 -0
- data/examples/stream_targets/custom/update.rb +43 -0
- data/examples/stream_targets/list.rb +24 -0
- data/examples/stream_targets/ull/create.rb +41 -0
- data/examples/stream_targets/ull/delete.rb +31 -0
- data/examples/stream_targets/ull/find.rb +23 -0
- data/examples/stream_targets/ull/list.rb +24 -0
- data/examples/stream_targets/ull/update.rb +43 -0
- data/examples/stream_targets/wowza/create.rb +42 -0
- data/examples/stream_targets/wowza/delete.rb +31 -0
- data/examples/stream_targets/wowza/find.rb +23 -0
- data/examples/stream_targets/wowza/list.rb +23 -0
- data/examples/stream_targets/wowza/update.rb +43 -0
- data/examples/transcoders/create.rb +39 -0
- data/examples/transcoders/delete.rb +31 -0
- data/examples/transcoders/find.rb +23 -0
- data/examples/transcoders/list.rb +24 -0
- data/examples/transcoders/reset.rb +32 -0
- data/examples/transcoders/reset_and_wait.rb +48 -0
- data/examples/transcoders/start.rb +33 -0
- data/examples/transcoders/start_and_wait.rb +50 -0
- data/examples/transcoders/state.rb +33 -0
- data/examples/transcoders/stats.rb +43 -0
- data/examples/transcoders/stop.rb +33 -0
- data/examples/transcoders/stop_and_wait.rb +50 -0
- data/examples/transcoders/thumbnail_url.rb +46 -0
- data/examples/transcoders/update.rb +43 -0
- data/images/wsc-ruby-1800x400.png +0 -0
- data/lib/wsc_sdk.rb +81 -0
- data/lib/wsc_sdk/client.rb +417 -0
- data/lib/wsc_sdk/configuration.rb +21 -0
- data/lib/wsc_sdk/constants.rb +29 -0
- data/lib/wsc_sdk/endpoint.rb +492 -0
- data/lib/wsc_sdk/endpoints/custom_stream_targets.rb +44 -0
- data/lib/wsc_sdk/endpoints/live_streams.rb +34 -0
- data/lib/wsc_sdk/endpoints/output_stream_targets.rb +17 -0
- data/lib/wsc_sdk/endpoints/outputs.rb +17 -0
- data/lib/wsc_sdk/endpoints/stream_targets.rb +45 -0
- data/lib/wsc_sdk/endpoints/transcoders.rb +38 -0
- data/lib/wsc_sdk/endpoints/ull_stream_targets.rb +44 -0
- data/lib/wsc_sdk/endpoints/wowza_stream_targets.rb +44 -0
- data/lib/wsc_sdk/enums.rb +31 -0
- data/lib/wsc_sdk/enums/billing_mode.rb +20 -0
- data/lib/wsc_sdk/enums/broadcast_location.rb +58 -0
- data/lib/wsc_sdk/enums/buffer_size.rb +41 -0
- data/lib/wsc_sdk/enums/closed_caption_type.rb +26 -0
- data/lib/wsc_sdk/enums/custom_provider.rb +32 -0
- data/lib/wsc_sdk/enums/delivery_method.rb +20 -0
- data/lib/wsc_sdk/enums/delivery_type.rb +20 -0
- data/lib/wsc_sdk/enums/encoder.rb +71 -0
- data/lib/wsc_sdk/enums/idle_timeout.rb +50 -0
- data/lib/wsc_sdk/enums/image_position.rb +26 -0
- data/lib/wsc_sdk/enums/player_type.rb +20 -0
- data/lib/wsc_sdk/enums/protocol.rb +23 -0
- data/lib/wsc_sdk/enums/target_delivery_protocol.rb +20 -0
- data/lib/wsc_sdk/enums/transcoder_type.rb +20 -0
- data/lib/wsc_sdk/enums/wowza_provider.rb +20 -0
- data/lib/wsc_sdk/errors.rb +115 -0
- data/lib/wsc_sdk/model.rb +515 -0
- data/lib/wsc_sdk/model_list.rb +42 -0
- data/lib/wsc_sdk/model_template.rb +27 -0
- data/lib/wsc_sdk/models/custom_stream_target.rb +34 -0
- data/lib/wsc_sdk/models/error.rb +53 -0
- data/lib/wsc_sdk/models/live_stream.rb +130 -0
- data/lib/wsc_sdk/models/live_stream_connection_code.rb +31 -0
- data/lib/wsc_sdk/models/live_stream_state.rb +20 -0
- data/lib/wsc_sdk/models/live_stream_stats.rb +20 -0
- data/lib/wsc_sdk/models/live_stream_thumbnail_url.rb +20 -0
- data/lib/wsc_sdk/models/output.rb +61 -0
- data/lib/wsc_sdk/models/output_stream_target.rb +37 -0
- data/lib/wsc_sdk/models/stream_target.rb +29 -0
- data/lib/wsc_sdk/models/transcoder.rb +135 -0
- data/lib/wsc_sdk/models/transcoder_boolean_stat.rb +41 -0
- data/lib/wsc_sdk/models/transcoder_connection_code.rb +29 -0
- data/lib/wsc_sdk/models/transcoder_float_stat.rb +40 -0
- data/lib/wsc_sdk/models/transcoder_integer_stat.rb +40 -0
- data/lib/wsc_sdk/models/transcoder_state.rb +31 -0
- data/lib/wsc_sdk/models/transcoder_stats.rb +51 -0
- data/lib/wsc_sdk/models/transcoder_stream_target_state.rb +29 -0
- data/lib/wsc_sdk/models/transcoder_string_stat.rb +40 -0
- data/lib/wsc_sdk/models/transcoder_thumbnail_url.rb +29 -0
- data/lib/wsc_sdk/models/ull_stream_target.rb +54 -0
- data/lib/wsc_sdk/models/wowza_stream_target.rb +60 -0
- data/lib/wsc_sdk/modules/api_response.rb +24 -0
- data/lib/wsc_sdk/modules/loggable.rb +44 -0
- data/lib/wsc_sdk/modules/transcoder_shared_methods.rb +221 -0
- data/lib/wsc_sdk/pagination.rb +89 -0
- data/lib/wsc_sdk/schema.rb +140 -0
- data/lib/wsc_sdk/schema_attribute.rb +349 -0
- data/lib/wsc_sdk/templates/custom_stream_target.rb +154 -0
- data/lib/wsc_sdk/templates/live_stream.rb +234 -0
- data/lib/wsc_sdk/templates/output.rb +133 -0
- data/lib/wsc_sdk/templates/transcoder.rb +97 -0
- data/lib/wsc_sdk/templates/ull_stream_target.rb +49 -0
- data/lib/wsc_sdk/templates/wowza_stream_target.rb +57 -0
- data/lib/wsc_sdk/version.rb +7 -0
- data/wsc_sdk.gemspec +48 -0
- metadata +460 -0
data/doc/file_list.html
ADDED
@@ -0,0 +1,56 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
5
|
+
<meta charset="utf-8" />
|
6
|
+
|
7
|
+
<link rel="stylesheet" href="css/full_list.css" type="text/css" media="screen" charset="utf-8" />
|
8
|
+
|
9
|
+
<link rel="stylesheet" href="css/common.css" type="text/css" media="screen" charset="utf-8" />
|
10
|
+
|
11
|
+
|
12
|
+
|
13
|
+
<script type="text/javascript" charset="utf-8" src="js/jquery.js"></script>
|
14
|
+
|
15
|
+
<script type="text/javascript" charset="utf-8" src="js/full_list.js"></script>
|
16
|
+
|
17
|
+
|
18
|
+
<title>File List</title>
|
19
|
+
<base id="base_target" target="_parent" />
|
20
|
+
</head>
|
21
|
+
<body>
|
22
|
+
<div id="content">
|
23
|
+
<div class="fixed_header">
|
24
|
+
<h1 id="full_list_header">File List</h1>
|
25
|
+
<div id="full_list_nav">
|
26
|
+
|
27
|
+
<span><a target="_self" href="class_list.html">
|
28
|
+
Classes
|
29
|
+
</a></span>
|
30
|
+
|
31
|
+
<span><a target="_self" href="method_list.html">
|
32
|
+
Methods
|
33
|
+
</a></span>
|
34
|
+
|
35
|
+
<span><a target="_self" href="file_list.html">
|
36
|
+
Files
|
37
|
+
</a></span>
|
38
|
+
|
39
|
+
</div>
|
40
|
+
|
41
|
+
<div id="search">Search: <input type="text" /></div>
|
42
|
+
</div>
|
43
|
+
|
44
|
+
<ul id="full_list" class="file">
|
45
|
+
|
46
|
+
|
47
|
+
<li id="object_README" class="odd">
|
48
|
+
<div class="item"><span class="object_link"><a href="index.html" title="README">README</a></span></div>
|
49
|
+
</li>
|
50
|
+
|
51
|
+
|
52
|
+
|
53
|
+
</ul>
|
54
|
+
</div>
|
55
|
+
</body>
|
56
|
+
</html>
|
data/doc/frames.html
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<meta charset="utf-8">
|
5
|
+
<title>Documentation by YARD 0.9.18</title>
|
6
|
+
</head>
|
7
|
+
<script type="text/javascript" charset="utf-8">
|
8
|
+
var match = unescape(window.location.hash).match(/^#!(.+)/);
|
9
|
+
var name = match ? match[1] : 'index.html';
|
10
|
+
name = name.replace(/^(\w+):\/\//, '').replace(/^\/\//, '');
|
11
|
+
window.top.location = name;
|
12
|
+
</script>
|
13
|
+
<noscript>
|
14
|
+
<h1>Oops!</h1>
|
15
|
+
<h2>YARD requires JavaScript!</h2>
|
16
|
+
</noscript>
|
17
|
+
</html>
|
Binary file
|
data/doc/index.html
ADDED
@@ -0,0 +1,570 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<meta charset="UTF-8">
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
6
|
+
<title>Wowza Streaming Cloud - SDK Code Documentation</title>
|
7
|
+
|
8
|
+
<link rel="stylesheet" href="css/style.css" type="text/css" charset="utf-8" />
|
9
|
+
|
10
|
+
<link rel="stylesheet" href="css/common.css" type="text/css" charset="utf-8" />
|
11
|
+
|
12
|
+
<link rel="stylesheet" href="css/custom.css" type="text/css" charset="utf-8" />
|
13
|
+
|
14
|
+
<script type="text/javascript" charset="utf-8">
|
15
|
+
pathId = "README";
|
16
|
+
relpath = '';
|
17
|
+
</script>
|
18
|
+
|
19
|
+
|
20
|
+
<script type="text/javascript" charset="utf-8" src="js/jquery.js"></script>
|
21
|
+
|
22
|
+
<script type="text/javascript" charset="utf-8" src="js/app.js"></script>
|
23
|
+
|
24
|
+
|
25
|
+
</head>
|
26
|
+
<body>
|
27
|
+
<div id="wowza-wrapper">
|
28
|
+
<header>
|
29
|
+
<div class="logo">
|
30
|
+
<a href="https://www.wowza.com">
|
31
|
+
<img src="https://cloud.wowza.com/apidocs/assets/logo.png" alt="Wowza Logo" />
|
32
|
+
</a>
|
33
|
+
<h1>Wowza Streaming Cloud<br/>SDK Code Documentation</h1>
|
34
|
+
<div class="clearfix"></div>
|
35
|
+
</div>
|
36
|
+
<div class="links">
|
37
|
+
<a href="https://www.wowza.com/">Wowza Home</a>
|
38
|
+
<a href="https://www.wowza.com/docs">Docs & APIS</a>
|
39
|
+
<a href="https://www.wowza.com/community/index.html">Forums</a>
|
40
|
+
<a href="https://www.wowza.com/support">Support</a>
|
41
|
+
</div>
|
42
|
+
<div class="clearfix"></div>
|
43
|
+
</header>
|
44
|
+
|
45
|
+
<div id="content">
|
46
|
+
<div class="nav_wrap">
|
47
|
+
<iframe id="nav" src="class_list.html?1"></iframe>
|
48
|
+
<div id="resizer"></div>
|
49
|
+
</div>
|
50
|
+
|
51
|
+
<div id="main" tabindex="-1">
|
52
|
+
<div id="header">
|
53
|
+
<div id="menu">
|
54
|
+
|
55
|
+
<a href="_index.html">Index</a> »
|
56
|
+
<span class="title">File: README</span>
|
57
|
+
|
58
|
+
</div>
|
59
|
+
|
60
|
+
<div id="search">
|
61
|
+
|
62
|
+
<a class="full_list_link" id="class_list_link"
|
63
|
+
href="class_list.html">
|
64
|
+
|
65
|
+
<svg width="24" height="24">
|
66
|
+
<rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
|
67
|
+
<rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
|
68
|
+
<rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
|
69
|
+
</svg>
|
70
|
+
</a>
|
71
|
+
|
72
|
+
</div>
|
73
|
+
<div class="clear"></div>
|
74
|
+
</div>
|
75
|
+
|
76
|
+
<div id="content"><div id='filecontents'>
|
77
|
+
<p><img src="images/wsc-ruby-1800x400.png"></p>
|
78
|
+
|
79
|
+
<h1 id="Wowza+Streaming+Cloud+Ruby+SDK">Wowza Streaming Cloud Ruby SDK</h1>
|
80
|
+
|
81
|
+
<p>Welcome to the official Wowza Streaming Cloud Ruby SDK (WscSdk). We help
|
82
|
+
developers bring live streaming into their applications - for any size
|
83
|
+
audience, anywhere in the world. This SDK leverages the Wowza Streaming
|
84
|
+
Cloud REST API to programmatically control live streams, transcoders,
|
85
|
+
outputs, and stream targets.</p>
|
86
|
+
|
87
|
+
<p>Need the basics? Get to know <a
|
88
|
+
href="https://www.wowza.com/products/streaming-cloud">Wowza Streaming
|
89
|
+
Cloud</a>.</p>
|
90
|
+
|
91
|
+
<h3 id="SDK+version">SDK version</h3>
|
92
|
+
|
93
|
+
<p>v1.3.0 (references Wowza Streaming Cloud REST API version 1.3)</p>
|
94
|
+
|
95
|
+
<h2 id="Contents">Contents</h2>
|
96
|
+
<ul><li>
|
97
|
+
<p><a href="#Features">Features</a></p>
|
98
|
+
</li><li>
|
99
|
+
<p><a href="#Installation">Installation</a></p>
|
100
|
+
</li><li>
|
101
|
+
<p><a href="#Start_building">Start building</a></p>
|
102
|
+
<ul><li>
|
103
|
+
<p><a href="#Get_your_api_key_and_generate_an_access_key">Get your API key and
|
104
|
+
generate an access key</a></p>
|
105
|
+
</li><li>
|
106
|
+
<p><a href="#Create_a_client">Create a client</a></p>
|
107
|
+
</li><li>
|
108
|
+
<p><a href="#Access_endpoints">Access endpoints</a></p>
|
109
|
+
</li><li>
|
110
|
+
<p><a href="#Use_templates">Use templates</a></p>
|
111
|
+
</li><li>
|
112
|
+
<p><a href="#Managing_lists">Manage Lists</a></p>
|
113
|
+
</li><li>
|
114
|
+
<p><a href="#Error_handling">Error Handling</a></p>
|
115
|
+
</li></ul>
|
116
|
+
</li><li>
|
117
|
+
<p><a href="#Access_the_entire_wowza_streaming_cloud_rest_api">Access the
|
118
|
+
entire Wowza Streaming Cloud REST API</a></p>
|
119
|
+
</li><li>
|
120
|
+
<p><a href="#Sdk_examples">SDK examples</a></p>
|
121
|
+
</li><li>
|
122
|
+
<p><a href="#Documentation">Documentation</a></p>
|
123
|
+
</li><li>
|
124
|
+
<p><a href="#Contribute">Contribute</a></p>
|
125
|
+
</li><li>
|
126
|
+
<p><a href="#Feedback">Feedback</a></p>
|
127
|
+
</li><li>
|
128
|
+
<p><a href="#Support">Support</a></p>
|
129
|
+
</li><li>
|
130
|
+
<p><a href="#Code_of_conduct">Code of conduct</a></p>
|
131
|
+
</li><li>
|
132
|
+
<p><a href="#License">License</a></p>
|
133
|
+
</li></ul>
|
134
|
+
|
135
|
+
<h2 id="Features">Features</h2>
|
136
|
+
|
137
|
+
<p>This SDK represents a subset of the Features available in the Wowza
|
138
|
+
Streaming Cloud REST API.</p>
|
139
|
+
<ul><li>
|
140
|
+
<p>Live streams</p>
|
141
|
+
</li><li>
|
142
|
+
<p>Transcoders</p>
|
143
|
+
</li><li>
|
144
|
+
<p>Outputs</p>
|
145
|
+
</li><li>
|
146
|
+
<p>Stream targets</p>
|
147
|
+
</li></ul>
|
148
|
+
|
149
|
+
<p>To add functionality related to players, stream sources, recordings,
|
150
|
+
schedules, and usage metrics, see <a
|
151
|
+
href="#Access_the_entire_wowza_streaming_cloud_rest_api">Access the entire
|
152
|
+
Wowza Streaming Cloud REST API</a>.</p>
|
153
|
+
|
154
|
+
<h2 id="Installation">Installation</h2>
|
155
|
+
|
156
|
+
<h3 id="Prerequisites">Prerequisites</h3>
|
157
|
+
<ul><li>
|
158
|
+
<p>Ruby version 2.3 or higher</p>
|
159
|
+
</li><li>
|
160
|
+
<p>Access to the Wowza Streaming Cloud service. You can start with our <a
|
161
|
+
href="https://www.wowza.com/pricing/cloud-developer-free-trial">free
|
162
|
+
trial</a>.</p>
|
163
|
+
</li></ul>
|
164
|
+
|
165
|
+
<h3 id="Install+the+SDK">Install the SDK</h3>
|
166
|
+
|
167
|
+
<p>To use <a href="https://rubygems.org/">RubyGems</a> for Installation, add
|
168
|
+
this line to your application's Gemfile:</p>
|
169
|
+
|
170
|
+
<pre class="code ruby"><code class="ruby">gem <span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">'</span><span style="color:#D20">wsc_sdk</span><span style="color:#710">'</span></span>, <span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">'</span><span style="color:#D20">~> 1.3.0</span><span style="color:#710">'</span></span>
|
171
|
+
</code></pre>
|
172
|
+
|
173
|
+
<p>And then execute:</p>
|
174
|
+
|
175
|
+
<pre class="code ruby"><code class="ruby"><span style="color:#F00;background-color:#FAA">$</span> bundle</code></pre>
|
176
|
+
|
177
|
+
<p>Or install it yourself using:</p>
|
178
|
+
|
179
|
+
<pre class="code ruby"><code class="ruby"><span style="color:#F00;background-color:#FAA">$</span> gem install wsc_sdk</code></pre>
|
180
|
+
|
181
|
+
<h2 id="Start+building">Start building</h2>
|
182
|
+
|
183
|
+
<h3 id="Get+your+API+key+and+generate+an+access+key">Get your API key and generate an access key</h3>
|
184
|
+
|
185
|
+
<p>Start by getting an API key and access key to authenticate requests.
|
186
|
+
You'll find them in the Wowza Streaming Cloud user interface.</p>
|
187
|
+
<ol><li>
|
188
|
+
<p>Sign in to <a href="https://cloud.wowza.com">Wowza Streaming Cloud</a>.</p>
|
189
|
+
</li><li>
|
190
|
+
<p>In the menu bar, click your user name and choose <strong>API
|
191
|
+
Access</strong>.</p>
|
192
|
+
</li></ol>
|
193
|
+
|
194
|
+
<p>See <a
|
195
|
+
href="https://www.wowza.com/docs/how-to-use-the-wowza-streaming-cloud-rest-api#keys">Locate
|
196
|
+
an API key and generate an access key</a> for more information.</p>
|
197
|
+
|
198
|
+
<h3 id="Create+a+client">Create a client</h3>
|
199
|
+
|
200
|
+
<p>To perform any SDK functions or API requests, start by creating an instance
|
201
|
+
of of the <code>WscSdk::Client</code> object. This object requires your API
|
202
|
+
key and access key. It handles all of the requirements for formulating a
|
203
|
+
valid API request, and it gives you access to functions for listing,
|
204
|
+
finding, creating, updating, and deleting models in the Wowza Streaming
|
205
|
+
Cloud REST API.</p>
|
206
|
+
|
207
|
+
<pre class="code ruby"><code class="ruby">require <span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">'</span><span style="color:#D20">wsc_sdk</span><span style="color:#710">'</span></span>
|
208
|
+
|
209
|
+
<span style="color:#036;font-weight:bold">WscSdk</span>.configure <span style="color:#080;font-weight:bold">do</span> |config|
|
210
|
+
config.api_key = <span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">"</span><span style="color:#D20">[your API key]</span><span style="color:#710">"</span></span>
|
211
|
+
config.access_key = <span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">"</span><span style="color:#D20">[your access key]</span><span style="color:#710">"</span></span>
|
212
|
+
config.logger = ::<span style="color:#036;font-weight:bold">Logger</span>.new(<span style="color:#069">STDOUT</span>)
|
213
|
+
<span style="color:#080;font-weight:bold">end</span>
|
214
|
+
|
215
|
+
client = <span style="color:#036;font-weight:bold">WscSdk</span>.client
|
216
|
+
</code></pre>
|
217
|
+
|
218
|
+
<h4 id="Set+up+environment+variables">Set up environment variables</h4>
|
219
|
+
|
220
|
+
<p>For higher levels of security, and to keep sensitive keys out of your
|
221
|
+
repositories, you can use environment variables to configure your clients.</p>
|
222
|
+
|
223
|
+
<p>In a terminal you can establish the environment variables like this:</p>
|
224
|
+
|
225
|
+
<pre class="code ruby"><code class="ruby">export <span style="color:#036;font-weight:bold">WSC_API_KEY</span>=[your-api-key]
|
226
|
+
export <span style="color:#036;font-weight:bold">WSC_API_ACCESS_KEY</span>=[your-api-access-key]
|
227
|
+
</code></pre>
|
228
|
+
|
229
|
+
<p>Then your configuration block can be setup like this:</p>
|
230
|
+
|
231
|
+
<pre class="code ruby"><code class="ruby">require <span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">'</span><span style="color:#D20">wsc_sdk</span><span style="color:#710">'</span></span>
|
232
|
+
|
233
|
+
<span style="color:#036;font-weight:bold">WscSdk</span>.configure <span style="color:#080;font-weight:bold">do</span> |config|
|
234
|
+
config.api_key = <span style="color:#069">ENV</span>[<span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">"</span><span style="color:#D20">WSC_API_KEY</span><span style="color:#710">"</span></span>]
|
235
|
+
config.access_key = <span style="color:#069">ENV</span>[<span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">"</span><span style="color:#D20">WSC_API_ACCESS_KEY</span><span style="color:#710">"</span></span>]
|
236
|
+
config.logger = ::<span style="color:#036;font-weight:bold">Logger</span>.new(<span style="color:#069">STDOUT</span>)
|
237
|
+
<span style="color:#080;font-weight:bold">end</span>
|
238
|
+
|
239
|
+
client = <span style="color:#036;font-weight:bold">WscSdk</span>.client
|
240
|
+
</code></pre>
|
241
|
+
|
242
|
+
<h4 id="Using+the+sandbox+for+testing">Using the sandbox for testing</h4>
|
243
|
+
|
244
|
+
<p>Wowza Streaming Cloud has a sandbox environment you can use for testing
|
245
|
+
your code without incurring charges on your account.</p>
|
246
|
+
|
247
|
+
<p>You can switch the hostname of the SDK to point the sandbox server for
|
248
|
+
testing using this configuration:</p>
|
249
|
+
|
250
|
+
<pre class="code ruby"><code class="ruby">require <span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">'</span><span style="color:#D20">wsc_sdk</span><span style="color:#710">'</span></span>
|
251
|
+
|
252
|
+
<span style="color:#036;font-weight:bold">WscSdk</span>.configure <span style="color:#080;font-weight:bold">do</span> |config|
|
253
|
+
config.api_key = <span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">"</span><span style="color:#D20">[your sandbox API key]</span><span style="color:#710">"</span></span>
|
254
|
+
config.access_key = <span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">"</span><span style="color:#D20">[your sandbox access key]</span><span style="color:#710">"</span></span>
|
255
|
+
config.logger = ::<span style="color:#036;font-weight:bold">Logger</span>.new(<span style="color:#069">STDOUT</span>)
|
256
|
+
conifg.hostname = <span style="color:#036;font-weight:bold">WscSdk</span>::<span style="color:#036;font-weight:bold">SANDBOX_HOSTNAME</span>
|
257
|
+
<span style="color:#080;font-weight:bold">end</span>
|
258
|
+
|
259
|
+
client = <span style="color:#036;font-weight:bold">WscSdk</span>.client
|
260
|
+
</code></pre>
|
261
|
+
|
262
|
+
<h3 id="Access+endpoints">Access endpoints</h3>
|
263
|
+
|
264
|
+
<p>You can access the controls for managing a model through endpoints. An
|
265
|
+
endpoint is typically named for the model you're managing, but in
|
266
|
+
plural form.</p>
|
267
|
+
|
268
|
+
<p>For example, you manage the <code>WscSdk::Models::Transcoder</code> model
|
269
|
+
through the <code>WscSdk::Endpoints::Transcoders</code> endpoint.</p>
|
270
|
+
|
271
|
+
<p>You can access endpoints through the <a href="#Create_a_client">client</a>
|
272
|
+
object.</p>
|
273
|
+
|
274
|
+
<p>Using the <code>transcoders</code> example, you can access functionality to
|
275
|
+
manage models like this:</p>
|
276
|
+
|
277
|
+
<pre class="code ruby"><code class="ruby"><span style="color:#777"># Assign the transcoders endpoint to a variable</span>
|
278
|
+
transcoders = client.transcoders
|
279
|
+
|
280
|
+
<span style="color:#777"># List all transcoders</span>
|
281
|
+
<span style="color:#777">#</span>
|
282
|
+
<span style="color:#777"># Returns a ModelList object which behaves like a Hash. The keys of the Hash</span>
|
283
|
+
<span style="color:#777"># are the primary keys of the model, and the values are the model themselves.</span>
|
284
|
+
<span style="color:#777">#</span>
|
285
|
+
list = transcoders.list
|
286
|
+
|
287
|
+
list.each <span style="color:#080;font-weight:bold">do</span> |id, transcoder|
|
288
|
+
<span style="color:#777"># Do something with the items in the list.</span>
|
289
|
+
<span style="color:#080;font-weight:bold">end</span>
|
290
|
+
|
291
|
+
<span style="color:#777"># Find a transcoder</span>
|
292
|
+
<span style="color:#777">#</span>
|
293
|
+
<span style="color:#777"># Returns the model that matches the primary key provided. If the primary</span>
|
294
|
+
<span style="color:#777"># key doesn't exist, a WscSdk::Models::Error object is returned.</span>
|
295
|
+
<span style="color:#777">#</span>
|
296
|
+
transcoders.find(<span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">'</span><span style="color:#D20">some_id</span><span style="color:#710">'</span></span>)
|
297
|
+
|
298
|
+
<span style="color:#777"># Create a transcoder</span>
|
299
|
+
<span style="color:#777">#</span>
|
300
|
+
<span style="color:#777"># Returns the model of the newly created object. If the validation failed,</span>
|
301
|
+
<span style="color:#777"># or there was an issue sending the data to the API, then a</span>
|
302
|
+
<span style="color:#777"># WscSdk::Models::Error object is returned.</span>
|
303
|
+
<span style="color:#777">#</span>
|
304
|
+
transcoders.create(some_transcoder_model)
|
305
|
+
|
306
|
+
<span style="color:#777"># Update a transcoder</span>
|
307
|
+
<span style="color:#777">#</span>
|
308
|
+
<span style="color:#777"># Returns the model of the updated object. If the validation failed,</span>
|
309
|
+
<span style="color:#777"># or there was an issue sending the data to the API, then a</span>
|
310
|
+
<span style="color:#777"># WscSdk::Models::Error object is returned.</span>
|
311
|
+
<span style="color:#777">#</span>
|
312
|
+
transcoders.update(some_transcoder_model)
|
313
|
+
|
314
|
+
<span style="color:#777"># Delete a transcoder</span>
|
315
|
+
<span style="color:#777">#</span>
|
316
|
+
<span style="color:#777"># Returns the model data of the deleted object, with the primary key value</span>
|
317
|
+
<span style="color:#777"># removed. If there was an issue sending the data to the API, then a</span>
|
318
|
+
<span style="color:#777"># WscSdk::Models::Error object is returned.</span>
|
319
|
+
<span style="color:#777">#</span>
|
320
|
+
transcoders.delete(some_transcoder_model)
|
321
|
+
</code></pre>
|
322
|
+
|
323
|
+
<p>The <code>Endpoint#list</code>, <code>Endpoint#find(id)</code>,
|
324
|
+
<code>Endpoint#create(model_object)</code>,
|
325
|
+
<code>Endpoint#update(model_object)</code>, and
|
326
|
+
<code>Endpoint#delete(model_object)</code> methods are the most common
|
327
|
+
methods inside of an endpoint, however these will change from
|
328
|
+
model-to-model, so check the code <a
|
329
|
+
href="#Documentation">Documentation</a> for specific details on the model
|
330
|
+
you're attempting to interact with.</p>
|
331
|
+
|
332
|
+
<h3 id="Use+templates">Use templates</h3>
|
333
|
+
|
334
|
+
<p>This SDK provides predefined templates to make it easier to configure a
|
335
|
+
model with common data values. Templates are available for live streams,
|
336
|
+
transcoders, outputs, custom stream targets, Wowza stream targets, and
|
337
|
+
ultra low latency stream targets.</p>
|
338
|
+
|
339
|
+
<p>You use a template when using an endpoint to create a model. For example,
|
340
|
+
to create a transcoder that uses the RTMP protocol to push a stream from
|
341
|
+
the source to Wowza Streaming Cloud, use a template like this:</p>
|
342
|
+
|
343
|
+
<pre class="code ruby"><code class="ruby"><span style="color:#777"># Build an RTMP/push transcoder using a predefined template</span>
|
344
|
+
name = <span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">"</span><span style="color:#D20">My First SDK Transcoder</span><span style="color:#710">"</span></span>
|
345
|
+
transcoder_data = <span style="color:#036;font-weight:bold">WscSdk</span>::<span style="color:#036;font-weight:bold">Templates</span>::<span style="color:#036;font-weight:bold">Transcoder</span>.rtmp_push(name)
|
346
|
+
</code></pre>
|
347
|
+
|
348
|
+
<p>Values for <em>transcoder_type</em>, <em>billing_mode</em>,
|
349
|
+
<em>broadcast_location</em>, <em>protocol</em>, <em>delivery_method</em>
|
350
|
+
and more are set by default.</p>
|
351
|
+
|
352
|
+
<p>To override a preset value, add a modifier key:value pair like this:</p>
|
353
|
+
|
354
|
+
<pre class="code ruby"><code class="ruby"><span style="color:#777"># Build an RTMP/push transcoder using a predefined template with a modifier</span>
|
355
|
+
name = <span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">"</span><span style="color:#D20">My First SDK Transcoder</span><span style="color:#710">"</span></span>
|
356
|
+
transcoder_data = <span style="color:#036;font-weight:bold">WscSdk</span>::<span style="color:#036;font-weight:bold">Templates</span>::<span style="color:#036;font-weight:bold">Transcoder</span>.rtmp_push(name, <span style="color:#606">broadcast_location</span>: <span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">"</span><span style="color:#D20">eu_germany</span><span style="color:#710">"</span></span>)
|
357
|
+
</code></pre>
|
358
|
+
|
359
|
+
<p>You can see the details for each available template in the <a
|
360
|
+
href="https://wowza.com/resources/wsc/sdk/ruby/WscSdk/Templates.html">Templates
|
361
|
+
Documentation</a>. Click <strong>View source</strong> to see the preset
|
362
|
+
values.</p>
|
363
|
+
|
364
|
+
<h3 id="Manage+lists">Manage lists</h3>
|
365
|
+
|
366
|
+
<p>All of the endpoints that return lists allow you to control how the data is
|
367
|
+
returned. You can configure the lists with following options:</p>
|
368
|
+
<ul><li>
|
369
|
+
<p><strong>Pagination</strong></p>
|
370
|
+
</li><li>
|
371
|
+
<p><strong>Filtering</strong></p>
|
372
|
+
</li></ul>
|
373
|
+
|
374
|
+
<h4 id="Paginate+lists">Paginate lists</h4>
|
375
|
+
|
376
|
+
<p>Most Wowza Streaming Cloud REST API endpoints allow you to paginate the
|
377
|
+
results of lists. The SDK fully Supports this functionality by passing
|
378
|
+
optional parameters to <code>client.[endpoint].list</code> requests.</p>
|
379
|
+
|
380
|
+
<h6 id="Pagination+parameters-3A">Pagination parameters:</h6>
|
381
|
+
<ul><li>
|
382
|
+
<p><strong>page</strong>: The page number of to request</p>
|
383
|
+
</li><li>
|
384
|
+
<p><strong>per_page</strong>: The number of items per page to request.</p>
|
385
|
+
</li></ul>
|
386
|
+
|
387
|
+
<p>Using your <a href="#Create_a_client">client</a> object, you can request a
|
388
|
+
paginated list like this:</p>
|
389
|
+
|
390
|
+
<pre class="code ruby"><code class="ruby">client.transcoders.list(<span style="color:#606">pagination</span>: { <span style="color:#606">page</span>: <span style="color:#00D">1</span>, <span style="color:#606">per_page</span>: <span style="color:#00D">20</span> })
|
391
|
+
</code></pre>
|
392
|
+
|
393
|
+
<p>The resulting list <code>Hash</code> will have a special key for the
|
394
|
+
pagination information called <code>:pagination</code>. If you access this
|
395
|
+
key, you'll get back information about the current pagination
|
396
|
+
information.</p>
|
397
|
+
|
398
|
+
<h4 id="Filter+lists">Filter lists</h4>
|
399
|
+
|
400
|
+
<p><strong>Note:</strong> Currently only the transcoders endpoint allows for
|
401
|
+
filtering items returned in the response.</p>
|
402
|
+
|
403
|
+
<p>To filter content returned in a list call, you can add the
|
404
|
+
<code>filter:</code> key to the <code>list</code> call.</p>
|
405
|
+
|
406
|
+
<p>The filter is a Hash of acceptable field names and filter values. Although
|
407
|
+
the API allows for more complex filtering, currently the SDK filter accepts
|
408
|
+
only direct equality filtering.</p>
|
409
|
+
|
410
|
+
<p>Using your <a href="#Create_a_client">client</a> object, you can request a
|
411
|
+
list of transcoders that are currently started, like this:</p>
|
412
|
+
|
413
|
+
<pre class="code ruby"><code class="ruby">client.transcoders.list(<span style="color:#606">filter</span>: { <span style="color:#606">state</span>: <span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">'</span><span style="color:#D20">started</span><span style="color:#710">'</span></span> })
|
414
|
+
</code></pre>
|
415
|
+
|
416
|
+
<h3 id="Error+handling">Error handling</h3>
|
417
|
+
|
418
|
+
<p>An SDK call that returns an unraised error will return it as a
|
419
|
+
<code>WscSdk::Models::Error</code> instance.</p>
|
420
|
+
|
421
|
+
<p>To determine if a model or model list generated an error during it's
|
422
|
+
request, you can call the <code>success?</code> method to determine the
|
423
|
+
outcome.</p>
|
424
|
+
|
425
|
+
<pre class="code ruby"><code class="ruby">transcoder_list = client.transcoders.list
|
426
|
+
|
427
|
+
<span style="color:#080;font-weight:bold">if</span> transcoder_list.success?
|
428
|
+
<span style="color:#777"># Do some stuff with your list.</span>
|
429
|
+
<span style="color:#080;font-weight:bold">else</span>
|
430
|
+
<span style="color:#777"># If it wasn't a success, then the returned model is an instance of WscSdk::Models::Error.</span>
|
431
|
+
puts <span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">"</span><span style="color:#D20">Your request for the transcoder list generated an error: </span><span style="background-color:hsla(0,0%,0%,0.07);color:black"><span style="font-weight:bold;color:#666">#{</span>transcoder_list.code<span style="font-weight:bold;color:#666">}</span></span><span style="color:#D20">: </span><span style="background-color:hsla(0,0%,0%,0.07);color:black"><span style="font-weight:bold;color:#666">#{</span>transcoder_list.title<span style="font-weight:bold;color:#666">}</span></span><span style="color:#710">"</span></span>
|
432
|
+
<span style="color:#080;font-weight:bold">end</span>
|
433
|
+
</code></pre>
|
434
|
+
|
435
|
+
<h2 id="Sending+files+through+the+SDK">Sending files through the SDK</h2>
|
436
|
+
|
437
|
+
<p>Some API endpoints allow you to send files for use in configuring a live
|
438
|
+
stream, transcoder, player or hosted page. These files must be converted
|
439
|
+
from their original format to a Base64-encoded string representation in
|
440
|
+
order to be processed by Wowza Streaming Cloud.</p>
|
441
|
+
|
442
|
+
<p>There is a static convenience method in the client that will load a file
|
443
|
+
from your local system and properly encode it for delivery to the API.</p>
|
444
|
+
|
445
|
+
<pre class="code ruby"><code class="ruby"><span style="color:#036;font-weight:bold">WscSdk</span>::<span style="color:#036;font-weight:bold">Client</span>.file_to_base64(<span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">"</span><span style="color:#D20">/path/to/some/file</span><span style="color:#710">"</span></span>)
|
446
|
+
</code></pre>
|
447
|
+
|
448
|
+
<p>For example, if you want to embed a watermark image into a transcoded
|
449
|
+
stream, your code might look like this:</p>
|
450
|
+
|
451
|
+
<pre class="code ruby"><code class="ruby">
|
452
|
+
transcoder = <span style="color:#d70">$client</span>.transcoders.build
|
453
|
+
|
454
|
+
transcoder.watermark_image = <span style="color:#036;font-weight:bold">WscSdk</span>::<span style="color:#036;font-weight:bold">Client</span>.file_to_base64(<span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">"</span><span style="color:#D20">/path/to/some/file.jpg</span><span style="color:#710">"</span></span>)
|
455
|
+
|
456
|
+
transcoder.save
|
457
|
+
</code></pre>
|
458
|
+
|
459
|
+
<h2 id="Access+the+entire+Wowza+Streaming+Cloud+REST+API">Access the entire Wowza Streaming Cloud REST API</h2>
|
460
|
+
|
461
|
+
<p>This SDK is still under active development, so many endpoints haven't
|
462
|
+
been built in just yet. To help with this, we've exposed a low-level
|
463
|
+
method inside the client for handling any endpoint inside the API.</p>
|
464
|
+
|
465
|
+
<p>This method generates the necessary request headers, does some basic
|
466
|
+
interpretation of the request, and returns a Hash object of the response
|
467
|
+
data. It doesn't do any data validation or management. It's up to
|
468
|
+
you to handle the data going in and coming out of the request and make sure
|
469
|
+
it's structured according to the Documentation.</p>
|
470
|
+
|
471
|
+
<p>See the <a href="https://sandbox.cloud.wowza.com/api/current/docs">Wowza
|
472
|
+
Streaming Cloud API reference</a> and <a
|
473
|
+
href="https://www.wowza.com/docs/wowza-streaming-cloud-rest-api">API
|
474
|
+
Documentation</a> for more information.</p>
|
475
|
+
|
476
|
+
<h5 id="Examples">Examples</h5>
|
477
|
+
|
478
|
+
<pre class="code ruby"><code class="ruby">
|
479
|
+
<span style="color:#777"># Request a list of players</span>
|
480
|
+
players_list = client.request_endpoint(<span style="color:#A60">:get</span>, <span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">"</span><span style="color:#D20">/players</span><span style="color:#710">"</span></span>)
|
481
|
+
|
482
|
+
<span style="color:#777"># Display the list of players and their types</span>
|
483
|
+
players_list[<span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">"</span><span style="color:#D20">players</span><span style="color:#710">"</span></span>].each <span style="color:#080;font-weight:bold">do</span> |player|
|
484
|
+
puts <span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">"</span><span style="background-color:hsla(0,0%,0%,0.07);color:black"><span style="font-weight:bold;color:#666">#{</span>player[<span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">"</span><span style="color:#D20">id</span><span style="color:#710">"</span></span>]<span style="font-weight:bold;color:#666">}</span></span><span style="color:#D20">: </span><span style="background-color:hsla(0,0%,0%,0.07);color:black"><span style="font-weight:bold;color:#666">#{</span>player[<span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">"</span><span style="color:#D20">type</span><span style="color:#710">"</span></span>]<span style="font-weight:bold;color:#666">}</span></span><span style="color:#710">"</span></span>
|
485
|
+
<span style="color:#080;font-weight:bold">end</span>
|
486
|
+
|
487
|
+
<span style="color:#777"># Get the details for the first player in the list</span>
|
488
|
+
player_id = player_list[<span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">"</span><span style="color:#D20">players</span><span style="color:#710">"</span></span>].first[<span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">"</span><span style="color:#D20">id</span><span style="color:#710">"</span></span>]
|
489
|
+
player = client.request_endpoint(<span style="color:#A60">:get</span>, <span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">"</span><span style="color:#D20">/players/</span><span style="background-color:hsla(0,0%,0%,0.07);color:black"><span style="font-weight:bold;color:#666">#{</span>player_id<span style="font-weight:bold;color:#666">}</span></span><span style="color:#710">"</span></span>)
|
490
|
+
|
491
|
+
<span style="color:#777"># Display the player details</span>
|
492
|
+
puts <span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">"</span><span style="color:#D20">Player:</span><span style="color:#710">"</span></span>
|
493
|
+
player[<span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">"</span><span style="color:#D20">player</span><span style="color:#710">"</span></span>].each <span style="color:#080;font-weight:bold">do</span> |attribute, value|
|
494
|
+
puts <span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">"</span><span style="color:#D20"> - </span><span style="background-color:hsla(0,0%,0%,0.07);color:black"><span style="font-weight:bold;color:#666">#{</span>attribute.to_s.ljust(<span style="color:#00D">25</span>)<span style="font-weight:bold;color:#666">}</span></span><span style="color:#D20"> : </span><span style="background-color:hsla(0,0%,0%,0.07);color:black"><span style="font-weight:bold;color:#666">#{</span>value<span style="font-weight:bold;color:#666">}</span></span><span style="color:#710">"</span></span>
|
495
|
+
<span style="color:#080;font-weight:bold">end</span>
|
496
|
+
|
497
|
+
<span style="color:#777"># Update an existing player.</span>
|
498
|
+
updated_player_data = {
|
499
|
+
<span style="color:#606">player</span>: {
|
500
|
+
<span style="color:#606">hosted_page_title</span>: <span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">"</span><span style="color:#D20">This is my updated Hosted Page with Player</span><span style="color:#710">"</span></span>,
|
501
|
+
<span style="color:#606">hosted_page_description</span>: <span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">"</span><span style="color:#D20">new description for my hosted page</span><span style="color:#710">"</span></span>
|
502
|
+
}
|
503
|
+
}
|
504
|
+
|
505
|
+
updated_player = client.request_endpoint(<span style="color:#A60">:post</span>, <span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">"</span><span style="color:#D20">/players/</span><span style="background-color:hsla(0,0%,0%,0.07);color:black"><span style="font-weight:bold;color:#666">#{</span>player_id<span style="font-weight:bold;color:#666">}</span></span><span style="color:#710">"</span></span>, updated_player_data)
|
506
|
+
puts <span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">"</span><span style="color:#D20">Player:</span><span style="color:#710">"</span></span>
|
507
|
+
player[<span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">"</span><span style="color:#D20">player</span><span style="color:#710">"</span></span>].each <span style="color:#080;font-weight:bold">do</span> |attribute, value|
|
508
|
+
puts <span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">"</span><span style="color:#D20"> - </span><span style="background-color:hsla(0,0%,0%,0.07);color:black"><span style="font-weight:bold;color:#666">#{</span>attribute.to_s.ljust(<span style="color:#00D">25</span>)<span style="font-weight:bold;color:#666">}</span></span><span style="color:#D20"> : </span><span style="background-color:hsla(0,0%,0%,0.07);color:black"><span style="font-weight:bold;color:#666">#{</span>value<span style="font-weight:bold;color:#666">}</span></span><span style="color:#710">"</span></span>
|
509
|
+
<span style="color:#080;font-weight:bold">end</span>
|
510
|
+
</code></pre>
|
511
|
+
|
512
|
+
<h2 id="SDK+examples">SDK examples</h2>
|
513
|
+
|
514
|
+
<p>Check out the ruby example files in this repo to learn how to use SDK
|
515
|
+
functions to configure and manage models.</p>
|
516
|
+
<ul><li>
|
517
|
+
<p><a href="/examples/client.rb">Set up a client</a></p>
|
518
|
+
</li><li>
|
519
|
+
<p><a href="/examples/live_streams">Work with live streams</a></p>
|
520
|
+
</li><li>
|
521
|
+
<p><a href="/examples/transcoders">Work with transcoders</a></p>
|
522
|
+
</li><li>
|
523
|
+
<p><a href="/examples/outputs">Work with outputs</a></p>
|
524
|
+
</li><li>
|
525
|
+
<p><a href="/examples/stream_targets">Work with stream targets</a></p>
|
526
|
+
</li></ul>
|
527
|
+
|
528
|
+
<h2 id="Documentation">Documentation</h2>
|
529
|
+
|
530
|
+
<p>You can dig into the details in the <a
|
531
|
+
href="https://wowza.com/resources/wsc/sdk/ruby/index.html">Wowza Streaming
|
532
|
+
Cloud Ruby SDK reference Documentation</a>.</p>
|
533
|
+
|
534
|
+
<h2 id="Contribute">Contribute</h2>
|
535
|
+
|
536
|
+
<p>For the moment, we're not accepting public contributions for the Wowza
|
537
|
+
Streaming Cloud Ruby SDK. We may open the code up to contributions in the
|
538
|
+
future. For now, relay your concerns and things you'd like to see added
|
539
|
+
by emailing us at <a
|
540
|
+
href="mailto:cloud-Feedback@wowza.com">cloud-Feedback@wowza.com</a>.</p>
|
541
|
+
|
542
|
+
<h2 id="Feedback">Feedback</h2>
|
543
|
+
|
544
|
+
<p>We welcome your Feedback on the SDK, its Documentation, and the experience
|
545
|
+
of using it. For now, we have disabled GitHub issues for this repo. To
|
546
|
+
provide Feedback, email us at <a
|
547
|
+
href="mailto:cloud-Feedback@wowza.com">cloud-Feedback@wowza.com</a>.</p>
|
548
|
+
|
549
|
+
<h2 id="Support">Support</h2>
|
550
|
+
|
551
|
+
<p>For now, we have disabled GitHub issues for this repo. To request
|
552
|
+
assistance with the SDK, open a Support ticket with <a
|
553
|
+
href="https://www.wowza.com/portal/help">Wowza Support</a>.</p>
|
554
|
+
|
555
|
+
<h2 id="Code+of+conduct">Code of conduct</h2>
|
556
|
+
|
557
|
+
<p>Please adhere to the guidelines described in the <a
|
558
|
+
href="#License">License</a> for this SDK.</p>
|
559
|
+
|
560
|
+
<h2 id="License">License</h2>
|
561
|
+
|
562
|
+
<p>This code is distributed under the <a href="LICENSE.txt">BSD-3 License</a>.</p>
|
563
|
+
</div></div>
|
564
|
+
|
565
|
+
|
566
|
+
</div>
|
567
|
+
</div>
|
568
|
+
</div>
|
569
|
+
</body>
|
570
|
+
</html>
|