Skip to content

Commit

Permalink
Fixed up the video selectors to work with multiple
Browse files Browse the repository at this point in the history
  • Loading branch information
gersh committed Jun 30, 2011
1 parent f9bc48b commit 7d46f55
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions lib/app/helpers/raydash_helper.rb
Expand Up @@ -9,12 +9,12 @@ def videostream(token, id,width="640",height="480",videoOff="0")
javascript_tag("swfobject.embedSWF(\"" + Raydash.getAssetUrl() + "/api/2/clientbox/1\", \"#{id}\",#{width},#{height},\"9.0.0\",\"http://www.adobe.com/products/flashplayer/download\",{autostart:1,token:\"#{token}\",videoOff:\"#{videoOff}\"},{allowscriptaccess:'always'},{});") + content_tag(:div, "Video stream not available", :id => id)
end
# This element sends video/audio to the server
def videorecord(token, id,width="640",height="480",hideCamera="0",videoOff="0")
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)
def videorecord(token, id,width="640",height="480",hideCamera="0",videoOff="0",microphoneOff="0")
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}\",microphoneOff:\"#{microphoneOff}\"},{allowscriptaccess:'always'},{});" ) + content_tag(:div, "Video stream not available", :id => id)
end
def video_selector(record_id,video_selector_id ="video_selector_id")
javascript_tag(<<-CODE
$(document).ready(function(){
jQuery(document).ready(function($){
var camerasEl;
var cameraInterval=setInterval(function(){
camerasEl = document.getElementById("#{record_id}");
Expand All @@ -38,7 +38,7 @@ def video_selector(record_id,video_selector_id ="video_selector_id")
end
def audio_selector(record_id,audio_selector_id="audio_selector_id")
javascript_tag(<<-CODE
$(document).ready(function(){
jQuery(document).ready(function($){
var audioEl;
var audioInterval=setInterval(function() {
audioEl = document.getElementById("#{record_id}");
Expand Down
2 changes: 1 addition & 1 deletion lib/raydash/version.rb
@@ -1,3 +1,3 @@
module Raydash
VERSION = "2.0.9"
VERSION = "2.1.0"
end

0 comments on commit 7d46f55

Please sign in to comment.