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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: bf5d334a509a06baeeb43e0d89f0937f4e96a3db
4
- data.tar.gz: 04bcbfcffe3cb15134b1aadb2db0ecc59a8166c7
3
+ metadata.gz: 86d62dca154aeb5249516a639629988640789cd4
4
+ data.tar.gz: e596e269c677a021e20a65fed7836bd008645c50
5
5
  SHA512:
6
- metadata.gz: 460b40e5b5a7fa7088d87faf4e89b0f57e1203c676f4e5947fc621bcb3f4cb0f6915d3edb52918c862e51c45db366ffec5a3f9a9a61383d3c8c3194b992989f2
7
- data.tar.gz: a4638145b882b29acb14e6f39119fa80e20919bbbfa6a9d47f78fbfcab31e6e494c260a094de9160b6913dbe7e20343140d77f3946f6a2f1b3e125018ecde243
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
- ### Initialize
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
- ### Create Stream
36
+ ### Example
37
+
38
+ #### Create Stream
37
39
 
38
40
  ```ruby
39
41
  Pili.create_stream(hub_name)
40
42
 
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
- }
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
- ### Get Stream
49
+ #### Get Stream
51
50
 
52
51
  ```ruby
53
52
  Pili.get_stream(stream_id)
54
53
  ```
55
54
 
56
- ### Update Stream
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
- ### Get Stream List
61
+ #### Get Stream List
63
62
 
64
63
  ```ruby
65
64
  Pili.stream_list(hub)
66
65
 
67
- Pili.stream_list(hub, marker: marker, limit: limit) # marker, limit: integer, optional
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
- ### Delete Stream
72
+ #### Delete Stream
71
73
 
72
74
  ```ruby
73
75
  Pili.delete_stream(stream_id)
74
76
  ```
75
77
 
76
- ### Get Stream Segments
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
- ### Get Stream Publish URL
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
- ### Get Stream RTMP Live URL
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
- ### Get Stream HLS Live URL
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
- ### Get Stream HLS Playback URL
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
@@ -1,3 +1,3 @@
1
1
  module Pili
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.3"
3
3
  end
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.2
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-04 00:00:00.000000000 Z
11
+ date: 2015-05-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler