pili 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +57 -33
- data/lib/pili/version.rb +1 -1
- data/lib/pili.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bdaa7674765c108d9c5188d267b4bc6c52a6ed82
|
4
|
+
data.tar.gz: fed41e06d022b17ac10951ec91a9ff293d3b2d66
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: afaf9fe81e1fe2670820ca592b6ff7a917b972b7a1d7abda20cc58a7b810cb5389ea43709984217c589010a41740f4ca634b100c95762fc01f4417118a9c56d6
|
7
|
+
data.tar.gz: dfea20eb80debda99461065a384f983aa8f5db98df1999200fe8fe6017b3a3c14b76be3e47dbfc36630e2cab605fa99e47740152c06ddf5169ee308c68caa3f2
|
data/README.md
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# pili-ruby
|
2
2
|
=========
|
3
3
|
|
4
|
-
|
4
|
+
Pili SDK for Ruby.
|
5
5
|
|
6
6
|
## Installation
|
7
7
|
|
@@ -21,10 +21,13 @@ Or install it yourself as:
|
|
21
21
|
|
22
22
|
### Initialize
|
23
23
|
|
24
|
-
|
24
|
+
```ruby
|
25
|
+
require 'pili'
|
26
|
+
|
27
|
+
Pili.setup! access_key: '<YOUR_APP_ACCESS_KEY>',
|
28
|
+
secret_key: '<YOUR_APP_SECRET_KEY>'
|
29
|
+
```
|
25
30
|
|
26
|
-
Pili.setup! access_key: '<YOUR_APP_ACCESS_KEY>',
|
27
|
-
secret_key: '<YOUR_APP_SECRET_KEY>'
|
28
31
|
#### with rails:
|
29
32
|
|
30
33
|
You'll need to configure it in config/initializes/pili.rb
|
@@ -32,62 +35,83 @@ You'll need to configure it in config/initializes/pili.rb
|
|
32
35
|
|
33
36
|
### Create Stream
|
34
37
|
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
38
|
+
```ruby
|
39
|
+
Pili.create_stream(hub_name)
|
40
|
+
|
41
|
+
stream_options = {
|
42
|
+
title: "test_name", # optional, default is auto-generated
|
43
|
+
publish_key: "test_key", # optional, a secret key for signing the <publishToken>
|
44
|
+
publish_security: "dynamic" # optional, can be "dynamic" or "static", default is "dynamic"
|
45
|
+
}
|
43
46
|
|
44
|
-
|
47
|
+
Pili.create_stream(hub_name, stream_options) # with options
|
48
|
+
```
|
45
49
|
|
46
50
|
### Get Stream
|
47
51
|
|
48
|
-
|
52
|
+
```ruby
|
53
|
+
Pili.get_stream(stream_id)
|
54
|
+
```
|
49
55
|
|
50
56
|
### Update Stream
|
51
57
|
|
52
|
-
|
58
|
+
```ruby
|
59
|
+
Pili.update_stream(stream_id, publish_key: publish_key, publish_security: publish_security)
|
60
|
+
```
|
53
61
|
|
54
62
|
### Get Stream List
|
55
63
|
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
64
|
+
```ruby
|
65
|
+
Pili.stream_list(hub)
|
66
|
+
|
67
|
+
Pili.stream_list(hub, marker: marker, limit: limit) # marker, limit: integer, optional
|
68
|
+
```
|
60
69
|
|
61
70
|
### Delete Stream
|
62
71
|
|
63
|
-
|
72
|
+
```ruby
|
73
|
+
Pili.delete_stream(stream_id)
|
74
|
+
```
|
64
75
|
|
65
76
|
### Get Stream Segments
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
77
|
+
|
78
|
+
```ruby
|
79
|
+
Pili.get_stream_segments(stream_id)
|
80
|
+
```
|
81
|
+
|
82
|
+
```ruby
|
83
|
+
# start, end: integer, optional
|
84
|
+
Pili.get_stream_segments(stream_id, start: timestamp, end: timestamp)
|
85
|
+
```
|
70
86
|
|
71
87
|
### Get Stream Publish URL
|
72
88
|
|
73
|
-
|
74
|
-
|
89
|
+
```ruby
|
90
|
+
Pili.get_stream_publish_url(stream_id, publish_key, publish_security)
|
91
|
+
Pili.get_stream_publish_url(stream_id, publish_key, publish_security, timestamp)
|
92
|
+
```
|
75
93
|
|
76
94
|
### Get Stream RTMP Live URL
|
77
95
|
|
78
|
-
|
79
|
-
|
96
|
+
```ruby
|
97
|
+
Pili.get_stream_rtmp_live_url(stream_id)
|
98
|
+
Pili.get_stream_rtmp_live_url(stream_id, preset)
|
99
|
+
```
|
80
100
|
|
81
101
|
### Get Stream HLS Live URL
|
82
102
|
|
83
|
-
|
84
|
-
|
103
|
+
```ruby
|
104
|
+
Pili.get_stream_hls_live_url(stream_id)
|
105
|
+
Pili.get_stream_hls_live_url(stream_id, preset)
|
106
|
+
```
|
85
107
|
|
86
108
|
### Get Stream HLS Playback URL
|
87
109
|
|
88
|
-
|
89
|
-
|
90
|
-
|
110
|
+
```ruby
|
111
|
+
Pili.get_stream_hls_playback_url(stream_id, start_second, end_second)
|
112
|
+
Pili.get_stream_hls_playback_url(stream_id, start_second, end_second, preset)
|
113
|
+
```
|
114
|
+
|
91
115
|
|
92
116
|
## Contributing
|
93
117
|
|
data/lib/pili/version.rb
CHANGED
data/lib/pili.rb
CHANGED
@@ -19,7 +19,7 @@ module Pili
|
|
19
19
|
def stream_list(hub, options = {})
|
20
20
|
url = Config.api_base_url + "/streams?hub=#{hub}"
|
21
21
|
|
22
|
-
url += "&marker=#{options[:marker]}"
|
22
|
+
url += "&marker=#{options[:marker]}" unless Utils.blank?(options[:marker])
|
23
23
|
url += "&limit=#{options[:limit]}" if options[:limit].is_a?(Fixnum)
|
24
24
|
|
25
25
|
response = HTTP.api_get(url)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pili
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Miclle
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-04-
|
11
|
+
date: 2015-04-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|