pili 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +29 -27
- data/lib/pili/config.rb +0 -7
- data/lib/pili/version.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: 86d62dca154aeb5249516a639629988640789cd4
|
4
|
+
data.tar.gz: e596e269c677a021e20a65fed7836bd008645c50
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d84320ecc9ffd6ec4f1f578b0c23e80868c49d3ed0c1b940267a5518c0c09a1b0bc9b84402f86cc8a7b4c29688a3a7b2d218e219f42ce2d58e865c4dc11ae3db
|
7
|
+
data.tar.gz: 80dea961acaf2dec714618e608b022d4797cf8a7abc2bc7e6357e82147c3bf848ea27c2616e247aea9c844c8d0db43f955f3da26572ec2b6864af63b738fc915
|
data/README.md
CHANGED
@@ -19,7 +19,7 @@ Or install it yourself as:
|
|
19
19
|
|
20
20
|
## Usage
|
21
21
|
|
22
|
-
###
|
22
|
+
### Configuration
|
23
23
|
|
24
24
|
```ruby
|
25
25
|
require 'pili'
|
@@ -33,47 +33,49 @@ Pili.setup! access_key: '<YOUR_APP_ACCESS_KEY>',
|
|
33
33
|
You'll need to configure it in config/initializes/pili.rb
|
34
34
|
|
35
35
|
|
36
|
-
###
|
36
|
+
### Example
|
37
|
+
|
38
|
+
#### Create Stream
|
37
39
|
|
38
40
|
```ruby
|
39
41
|
Pili.create_stream(hub_name)
|
40
42
|
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
}
|
46
|
-
|
47
|
-
Pili.create_stream(hub_name, stream_options) # with options
|
43
|
+
# title: optional, default is auto-generated
|
44
|
+
# publish_key: optional, a secret key for signing the <publishToken>
|
45
|
+
# publish_security: optional, can be "dynamic" or "static", default is "dynamic"
|
46
|
+
Pili.create_stream(hub_name, title: title, publish_key: publish_key, publish_security: publish_security)
|
48
47
|
```
|
49
48
|
|
50
|
-
|
49
|
+
#### Get Stream
|
51
50
|
|
52
51
|
```ruby
|
53
52
|
Pili.get_stream(stream_id)
|
54
53
|
```
|
55
54
|
|
56
|
-
|
55
|
+
#### Update Stream
|
57
56
|
|
58
57
|
```ruby
|
59
58
|
Pili.update_stream(stream_id, publish_key: publish_key, publish_security: publish_security)
|
60
59
|
```
|
61
60
|
|
62
|
-
|
61
|
+
#### Get Stream List
|
63
62
|
|
64
63
|
```ruby
|
65
64
|
Pili.stream_list(hub)
|
66
65
|
|
67
|
-
|
66
|
+
# hub: string, required
|
67
|
+
# marker: string, optional
|
68
|
+
# limit: integer, optional
|
69
|
+
Pili.stream_list(hub, marker: marker, limit: limit)
|
68
70
|
```
|
69
71
|
|
70
|
-
|
72
|
+
#### Delete Stream
|
71
73
|
|
72
74
|
```ruby
|
73
75
|
Pili.delete_stream(stream_id)
|
74
76
|
```
|
75
77
|
|
76
|
-
|
78
|
+
#### Get Stream Segments
|
77
79
|
|
78
80
|
```ruby
|
79
81
|
Pili.get_stream_segments(stream_id)
|
@@ -84,32 +86,32 @@ Pili.get_stream_segments(stream_id)
|
|
84
86
|
Pili.get_stream_segments(stream_id, start: timestamp, end: timestamp)
|
85
87
|
```
|
86
88
|
|
87
|
-
|
89
|
+
#### Get Stream Publish URL
|
88
90
|
|
89
91
|
```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
|
+
Pili.get_stream_publish_url(publish_host, stream_id, publish_key, publish_security)
|
93
|
+
Pili.get_stream_publish_url(publish_host, stream_id, publish_key, publish_security, timestamp)
|
92
94
|
```
|
93
95
|
|
94
|
-
|
96
|
+
#### Get Stream RTMP Live URL
|
95
97
|
|
96
98
|
```ruby
|
97
|
-
Pili.get_stream_rtmp_live_url(stream_id)
|
98
|
-
Pili.get_stream_rtmp_live_url(stream_id, preset)
|
99
|
+
Pili.get_stream_rtmp_live_url(rtmp_play_host, stream_id)
|
100
|
+
Pili.get_stream_rtmp_live_url(rtmp_play_host, stream_id, preset)
|
99
101
|
```
|
100
102
|
|
101
|
-
|
103
|
+
#### Get Stream HLS Live URL
|
102
104
|
|
103
105
|
```ruby
|
104
|
-
Pili.get_stream_hls_live_url(stream_id)
|
105
|
-
Pili.get_stream_hls_live_url(stream_id, preset)
|
106
|
+
Pili.get_stream_hls_live_url(hls_play_host, stream_id)
|
107
|
+
Pili.get_stream_hls_live_url(hls_play_host, stream_id, preset)
|
106
108
|
```
|
107
109
|
|
108
|
-
|
110
|
+
#### Get Stream HLS Playback URL
|
109
111
|
|
110
112
|
```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
|
+
Pili.get_stream_hls_playback_url(hls_play_host, stream_id, start_second, end_second)
|
114
|
+
Pili.get_stream_hls_playback_url(hls_play_host, stream_id, start_second, end_second, preset)
|
113
115
|
```
|
114
116
|
|
115
117
|
|
data/lib/pili/config.rb
CHANGED
@@ -7,13 +7,6 @@ module Pili
|
|
7
7
|
:api_version => "v1",
|
8
8
|
:api_scheme => "http",
|
9
9
|
:api_host => "pili.qiniuapi.com"
|
10
|
-
|
11
|
-
# :rtmp_publish_host => "pub.z1.glb.pili.qiniup.com",
|
12
|
-
# :rtmp_play_host => "live.z1.glb.pili.qiniucdn.com",
|
13
|
-
# :hls_play_host => "hls.z1.glb.pili.qiniuapi.com",
|
14
|
-
|
15
|
-
# :access_key => "",
|
16
|
-
# :secret_key => ""
|
17
10
|
}
|
18
11
|
|
19
12
|
REQUIRED_OPTION_KEYS = [:access_key, :secret_key]
|
data/lib/pili/version.rb
CHANGED
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.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Miclle
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-05-
|
11
|
+
date: 2015-05-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|