raydash 2.0.5 → 2.0.6

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.
@@ -12,4 +12,51 @@ module RaydashHelper
12
12
  def videorecord(token, id,width="640",height="480",hideCamera="0",videoOff="0")
13
13
  javascript_tag("function setSize(width,height,id) {if(id==undefined){id=\"#{id}\"; }document.getElementById(id).width=width;document.getElementById(id).height=height;}\n" + "\nvar server_version=2;\nvar version=swfobject.getFlashPlayerVersion();if(version.major<10 || version.minor<3) {server_version=1;}" + "else {server_version=2;}\nswfobject.embedSWF(\"" + Raydash.getAssetUrl() + "/api/2/recordbox/\" + server_version , \"#{id}\",#{width},#{height},\"9.0.0\",\"http://www.adobe.com/products/flashplayer/download\",{hideControls:1,hideCamera:\"#{hideCamera}\",autostart:1,token:\"#{token}\",videoOff:\"#{videoOff}\"},{allowscriptaccess:'always'},{});" ) + content_tag(:div, "Video stream not available", :id => id)
14
14
  end
15
+ def video_selector(record_id,video_selector_id ="video_selector_id")
16
+ javascript_tag(<<-CODE
17
+ $(document).ready(function(){
18
+ var camerasEl;
19
+ var cameraInterval=setInterval(function(){
20
+ camerasEl = document.getElementById("#{record_id}");
21
+ if(camerasEl != undefined && camerasEl.getCameras && camerasEl.getCameras()) {
22
+ clearInterval(cameraInterval);
23
+ var cameras=camerasEl.getCameras();
24
+ for(var i in cameras) {
25
+ $("##{video_selector_id}").append("<option value=\\"" +i +"\\">" + cameras[i] + "</option>\\n");
26
+ }
27
+ }
28
+ },500);
29
+ $("##{video_selector_id}_btn").click(function(){
30
+ camerasEl.changeCamera($("##{video_selector_id}").val());
31
+ });
32
+
33
+ });
34
+ CODE
35
+ ) +
36
+ content_tag(:select,"",:id => video_selector_id) +
37
+ content_tag(:button,"Change Video",:id=>video_selector_id + "_btn")
38
+ end
39
+ def audio_selector(record_id,audio_selector_id="audio_selector_id")
40
+ javascript_tag(<<-CODE
41
+ $(document).ready(function(){
42
+ var audioEl;
43
+ var audioInterval=setInterval(function() {
44
+ audioEl = document.getElementById("#{record_id}");
45
+ if(audioEl != undefined && audioEl.getMicrophones && audioEl.getMicrophones()) {
46
+ clearInterval(audioInterval);
47
+ var microphones = audioEl.getMicrophones();
48
+ for(var i in microphones) {
49
+ $("##{audio_selector_id}").append("<option value=\\"" + i + "\\">" + microphones[i] + "</option>\\n");
50
+ }
51
+ }
52
+ },500);
53
+ $("##{audio_selector_id}_btn").click(function(){
54
+ audioEl.changeMicrophone($("##{audio_selector_id}").val());
55
+ });
56
+ });
57
+ CODE
58
+ ) +
59
+ content_tag(:select,"", :id=> audio_selector_id) +
60
+ content_tag(:button,"Change Audio",:id => audio_selector_id + "_btn")
61
+ end
15
62
  end
@@ -1,3 +1,3 @@
1
1
  module Raydash
2
- VERSION = "2.0.5"
2
+ VERSION = "2.0.6"
3
3
  end
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: 5
4
+ hash: 3
5
5
  prerelease:
6
6
  segments:
7
7
  - 2
8
8
  - 0
9
- - 5
10
- version: 2.0.5
9
+ - 6
10
+ version: 2.0.6
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-06-04 00:00:00 -05:00
18
+ date: 2011-06-09 00:00:00 -05:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency