raydash 0.0.4 → 0.1.0

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.
data/ChangeLog ADDED
@@ -0,0 +1,2 @@
1
+ 0.1.0
2
+ Added getStreamInfo to find out information about a stream, and added setCallBackUrl, which allows callbacks on different event
data/Readme CHANGED
@@ -66,7 +66,7 @@ controller function such as:
66
66
 
67
67
  def connect_to()
68
68
  video=Model.find(params[:id1])
69
- video.connect_to(params[:id2])
69
+ video.point_to(params[:id2])
70
70
  end
71
71
 
72
72
  with route
@@ -2,10 +2,10 @@ module RaydashHelper
2
2
  def raydash_header()
3
3
  javascript_include_tag 'swfobject.js'
4
4
  end
5
- def videostream(token, id,width="500",height="500")
5
+ def videostream(token, id,width="640",height="480")
6
6
  javascript_tag("swfobject.embedSWF(\"/swfs/raydash/ClientBox.swf\", \"#{id}\",#{width},#{height},\"9.0.0\",\"http://www.adobe.com/products/flashplayer/download\",{autostart:1,token:\"#{token}\"})") + content_tag(:div, "Video stream not available", :id => id)
7
7
  end
8
- def videorecord(token, id,width="500",height="500")
8
+ def videorecord(token, id,width="640",height="480")
9
9
  javascript_tag("swfobject.embedSWF(\"/swfs/raydash/RecordBox.swf\", \"#{id}\",#{width},#{height},\"9.0.0\",\"http://www.adobe.com/products/flashplayer/download\",{hideControls:1,hideCamera:0,autostart:1,token:\"#{token}\"})") + content_tag(:div, "Video stream not available", :id => id)
10
10
  end
11
11
  end
@@ -1,3 +1,3 @@
1
1
  module Raydash
2
- VERSION = "0.0.4"
2
+ VERSION = "0.1.0"
3
3
  end
data/lib/raydash.rb CHANGED
@@ -1,5 +1,6 @@
1
1
  require 'net/http'
2
2
  require 'app/helpers/raydash_helper'
3
+ require 'json'
3
4
  module Raydash
4
5
  RAYDASH_HTTP_SERVER = "api.raydash.com"
5
6
  RAYDASH_HTTP_PORT = 8080
@@ -7,9 +8,6 @@ module Raydash
7
8
  mattr_accessor :userid
8
9
  mattr_accessor :secret
9
10
 
10
- def self.doRequest(request)
11
- return Net::HTTP.get_response(RAYDASH_HTTP_SERVER, request, RAYDASH_HTTP_PORT)
12
- end
13
11
  # Gets a new token for internal or external streams. The same token can be re-used for input and output streams.
14
12
  def self.getToken(streamName="")
15
13
  if streamName!="" then
@@ -28,10 +26,29 @@ module Raydash
28
26
  result.value()
29
27
  return result.body
30
28
  end
31
-
29
+ # Gets information about the stream
30
+ def self.getStreamInfo(token)
31
+ path="/api/1/streamInfo/" + token + "?userid=" + self.userid + "&secret=" + self.secret
32
+ result = doRequest(path)
33
+ result.value()
34
+ return JSON.parse(result.body)
35
+ end
36
+ # Sets a callback url with three parameters
37
+ def self.setCallbackUrl(userid, secret, url)
38
+ path="/api/1/callbackurl/" + self.userid + "?userid=" + self.userid + "&secret=" + self.secret + "&url=" + CGI::escape(url)
39
+ result = doRequest(path)
40
+ result.value()
41
+ return JSON.parse(result.body)
42
+ end
32
43
  # Used for configuration
33
44
  def self.setup
34
45
  yield self
35
46
  end
47
+
48
+ private
49
+ def self.doRequest(request)
50
+ return Net::HTTP.get_response(RAYDASH_HTTP_SERVER, request, RAYDASH_HTTP_PORT)
51
+ end
52
+
36
53
  end
37
54
  ActionView::Base.send :include, RaydashHelper
data/raydash.gemspec CHANGED
@@ -13,6 +13,8 @@ Gem::Specification.new do |s|
13
13
  s.description = %q{Live video chat or video streams can be hosted on Raydash, and accessed via the API contained within this gem}
14
14
 
15
15
  s.rubyforge_project = "raydash"
16
+
17
+ s.add_dependency('json')
16
18
 
17
19
  s.files = `git ls-files`.split("\n")
18
20
  s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: raydash
3
3
  version: !ruby/object:Gem::Version
4
- hash: 23
4
+ hash: 27
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
+ - 1
8
9
  - 0
9
- - 4
10
- version: 0.0.4
10
+ version: 0.1.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - Gershon Bialer
@@ -15,10 +15,23 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-02-13 00:00:00 -06:00
18
+ date: 2011-02-16 00:00:00 -06:00
19
19
  default_executable:
20
- dependencies: []
21
-
20
+ dependencies:
21
+ - !ruby/object:Gem::Dependency
22
+ name: json
23
+ prerelease: false
24
+ requirement: &id001 !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ">="
28
+ - !ruby/object:Gem::Version
29
+ hash: 3
30
+ segments:
31
+ - 0
32
+ version: "0"
33
+ type: :runtime
34
+ version_requirements: *id001
22
35
  description: Live video chat or video streams can be hosted on Raydash, and accessed via the API contained within this gem
23
36
  email:
24
37
  - gershon@raydash.com
@@ -30,6 +43,7 @@ extra_rdoc_files: []
30
43
 
31
44
  files:
32
45
  - .gitignore
46
+ - ChangeLog
33
47
  - Gemfile
34
48
  - Rakefile
35
49
  - Readme