raydash 0.2.2 → 0.3.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/Readme
CHANGED
@@ -73,6 +73,45 @@ controller function such as:
|
|
73
73
|
|
74
74
|
When connect_to is called, it will point on stream at another stream
|
75
75
|
|
76
|
+
== Helpers
|
77
|
+
These can be used within any view you use the Raydash gem.
|
78
|
+
=== raydash_header()
|
79
|
+
Generates the html for the header to include necessary javascript files to use raydash
|
80
|
+
=== videostream(token,id,height="640",width="480",videoOff="0")
|
81
|
+
Adds an flash element that plays video and sound
|
82
|
+
|
83
|
+
- token The token for the stream. You can generate a new token with Raydash.getToken(), or it is done automatically in models generated with "rails g raydash:model".
|
84
|
+
- id The div id for use within the HTML. This can be useful for interacting with the javascript API
|
85
|
+
- height The height of the videostream
|
86
|
+
- width The width of the videostream
|
87
|
+
- videoOff if "1", it will hide the video, and only stream audio.
|
88
|
+
=== videorecord(token,id,height="640",width="480",hideCamera="0")
|
89
|
+
Adds a flash element to record and send to the server video and sound
|
90
|
+
|
91
|
+
- token The token for the stream. You can generate a new with Raydash.getToken(), or it is done automatically in models generated with "rails g raydash:model".
|
92
|
+
- id The div id for use within the HTML. This can be useful for interacting with the javascript API
|
93
|
+
- height The height of videorecord
|
94
|
+
- width The width of videorecord
|
95
|
+
- hideCamera if "1", it will hide the camera. This is useful is you don't want to show the camera
|
96
|
+
- videoOff if "1", it will only stream audio.
|
97
|
+
|
98
|
+
== Javascript API
|
99
|
+
Generally, most functionality should be performed via the backend API. However, there is a Javascript API for working with the flash elements for certain purposes. You can call these elements by using document.getElementById("id"), where id is the id you specify when you add the element to your page
|
100
|
+
=== Videostream
|
101
|
+
==== play()
|
102
|
+
If you aren't currently playing the stream, start playing. Generally, the stream auto-starts when you load the page in your web browser, so it is unneccessary to use this
|
103
|
+
==== stop()
|
104
|
+
Stop playing any stream. Note: It is often preferrable to use changeStream in the backend API to switch to a black stream. There is a special token, "dummyblack" on the server for this purpose
|
105
|
+
=== Videorecord
|
106
|
+
==== play()
|
107
|
+
If you aren't currently recording the stream, it starts recording. Generally, the recording auto-starts when you load the page in your web browser, so it is unneccessary to use this
|
108
|
+
==== stop()
|
109
|
+
Totally stops all recording.
|
110
|
+
==== changeResolution(width,height)
|
111
|
+
Changes the resolution and size of the video recording
|
112
|
+
-width The new width
|
113
|
+
-height The new height
|
114
|
+
|
76
115
|
== Backend-API library
|
77
116
|
|
78
117
|
=== Raydash.getToken(streamName="")
|
@@ -86,7 +125,7 @@ from the call of that function
|
|
86
125
|
|
87
126
|
=== Raydash.changeStream(output_token, input_token)
|
88
127
|
The function re-points where a token is streaming from. We can
|
89
|
-
dynamically change where any stream is pointing, dynamically.
|
128
|
+
dynamically change where any stream is pointing, dynamically. You can point to the input_token "dummyblack" to make the window totally black.
|
90
129
|
|
91
130
|
output_token is the name of the token we are streaming to. If we have
|
92
131
|
a video stream initialized with this token, if will immediately start
|
@@ -2,10 +2,12 @@ module RaydashHelper
|
|
2
2
|
def raydash_header()
|
3
3
|
javascript_include_tag 'swfobject.js'
|
4
4
|
end
|
5
|
-
|
6
|
-
|
5
|
+
# This elements plays video/audio from the server
|
6
|
+
def videostream(token, id,width="640",height="480",videoOff="0")
|
7
|
+
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}\",videoOff:\"#{videoOff}\"})") + content_tag(:div, "Video stream not available", :id => id)
|
7
8
|
end
|
8
|
-
|
9
|
-
|
9
|
+
# This element sends video/audio to the server
|
10
|
+
def videorecord(token, id,width="640",height="480",hideCamera="0",videoOff="0")
|
11
|
+
javascript_tag("swfobject.embedSWF(\"/swfs/raydash/RecordBox.swf\", \"#{id}\",#{width},#{height},\"9.0.0\",\"http://www.adobe.com/products/flashplayer/download\",{hideControls:1,hideCamera:\"#{hideCamera}\",autostart:1,token:\"#{token}\",videoOff:\"#{videoOff}\"})") + content_tag(:div, "Video stream not available", :id => id)
|
10
12
|
end
|
11
13
|
end
|
Binary file
|
Binary file
|
data/lib/raydash/version.rb
CHANGED
metadata
CHANGED
@@ -5,9 +5,9 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
|
-
-
|
9
|
-
-
|
10
|
-
version: 0.
|
8
|
+
- 3
|
9
|
+
- 0
|
10
|
+
version: 0.3.0
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Gershon Bialer
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-03-
|
18
|
+
date: 2011-03-12 23:00:00 -06:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|