diff --git a/record-and-playback/presentation/playback/presentation/playback.html b/record-and-playback/presentation/playback/presentation/playback.html index 45be4f7086bb0e184f6ed257566a8a04bb5d7d0d..e983c92cb96e9a0920cb1feee31b4bb984c77b40 100755 --- a/record-and-playback/presentation/playback/presentation/playback.html +++ b/record-and-playback/presentation/playback/presentation/playback.html @@ -44,7 +44,7 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>. </div> </div> <p id="footer">Recorded with <a href="http://bigbluebutton.org/">BigBlueButton</a>.</p> - <script src='lib/writing.js'></script> +<!-- <script src='lib/writing.js'></script> --> </body> </html> diff --git a/record-and-playback/presentation/playback/presentation/playback.js b/record-and-playback/presentation/playback/presentation/playback.js index ae60fa1f72da0e1469a827e4286c2092c70f1c01..98dfa24e23b94bcbff5e2a9445a88669094d67cd 100644 --- a/record-and-playback/presentation/playback/presentation/playback.js +++ b/record-and-playback/presentation/playback/presentation/playback.js @@ -236,6 +236,7 @@ load_video = function(video){ load_audio = function() { audio = document.createElement("audio") + chat = document.getElementById("chat") audio.setAttribute('src', RECORDINGS + '/audio/audio.ogg'); audio.setAttribute('type','audio/ogg'); audio.setAttribute('id','video'); @@ -243,8 +244,17 @@ load_audio = function() { audio.setAttribute('autoplay','autoplay'); audio.setAttribute('data-timeline-sources', SLIDES_XML); document.getElementById("audioRecordingWrapper").appendChild(audio) -} + document.getElementById("video").style.height = "40px"; + chat.style.height = "560px"; + chat.style.backgroundColor = "white"; +} +load_script = function(file){ + script = document.createElement('script'); + script.src = file; + script.type = 'text/javascript'; + document.getElementsByTagName('body').item(0).appendChild(script); +} document.addEventListener( "DOMContentLoaded", function() { var appName = navigator.appName; @@ -263,7 +273,7 @@ document.addEventListener( "DOMContentLoaded", function() { } },true); load_video(video) - + load_script("lib/writing.js"); generateThumbnails(); }, false); diff --git a/record-and-playback/presentation/scripts/publish/presentation.rb b/record-and-playback/presentation/scripts/publish/presentation.rb index a371fb875e53b1d3b835b7e9c7cf0f8817826412..e306ae9751b82816df4a19db99b9790427979b97 100755 --- a/record-and-playback/presentation/scripts/publish/presentation.rb +++ b/record-and-playback/presentation/scripts/publish/presentation.rb @@ -226,14 +226,37 @@ def processClearImages end def storePencilShape - $line_count = $line_count + 1 # always update the line count! - $xml.g(:class => :shape, :id=>"draw#{$shapeCreationTime}", :undo => $shapeUndoTime, :shape =>"line#{$line_count}", :style => "stroke:\##{$colour_hex}; stroke-width:#{$shapeThickness}; visibility:hidden; stroke-linecap: round; ") do + $pencil_count = $pencil_count + 1 # always update the line count! + $xml.g(:class => :shape, :id=>"draw#{$shapeCreationTime}", :undo => $shapeUndoTime, :shape =>"line#{$pencil_count}", :style => "stroke:\##{$colour_hex}; stroke-width:#{$shapeThickness}; visibility:hidden; stroke-linecap: round; ") do for i in (0...($shapeDataPoints.length/2)-1) do $xml.line(:x1 => (($shapeDataPoints[i*2].to_f)/100)*$vbox_width, :y1 => (($shapeDataPoints[(i*2)+1].to_f)/100)*$vbox_height, :x2 => (($shapeDataPoints[(i*2)+2].to_f)/100)*$vbox_width, :y2 => (($shapeDataPoints[(i*2)+3].to_f)/100)*$vbox_height) end end end +def storeLineShape + if($shapeCreationTime != $prev_time) + if(($originalOriginX == (($shapeDataPoints[0].to_f)/100)*$vbox_width) && ($originalOriginY == (($shapeDataPoints[1].to_f)/100)*$vbox_height)) + # do not update the line count + else + $line_count = $line_count + 1 + end + $xml.g(:class => :shape, :id => "draw#{$shapeCreationTime}", :undo => $shapeUndoTime, :shape => "line#{$line_count}", :style => "stroke:\##{$colour_hex}; stroke-width:#{$shapeThickness}; visibility:hidden; fill:none") do + + $originX = (($shapeDataPoints[0].to_f)/100)*$vbox_width + $originY = (($shapeDataPoints[1].to_f)/100)*$vbox_height + endPointX = (($shapeDataPoints[2].to_f)/100)*$vbox_width + endPointY = (($shapeDataPoints[3].to_f)/100)*$vbox_height + + $originalOriginX = $originX + $originalOriginY = $originY + + $xml.line(:x1 => $originX, :y1 => $originY, :x2 => endPointY, :y2 => endPointY ) + $prev_time = $shapeCreationTime + end + end +end + def storeRectShape if($shapeCreationTime != $prev_time) if(($originalOriginX == (($shapeDataPoints[0].to_f)/100)*$vbox_width) && ($originalOriginY == (($shapeDataPoints[1].to_f)/100)*$vbox_height)) @@ -333,6 +356,13 @@ end def storeTextShape if($shapeCreationTime != $prev_time) + $originX = (($shapeDataPoints[0].to_f)/100)*$vbox_width + $originY = (($shapeDataPoints[1].to_f)/100)*$vbox_height + if(($originalOriginX == $originX) && ($originalOriginY == $originY)) + # do not update the text count + else + $text_count = $text_count + 1 + end font_size_factor = 2 y_gap = 45 $textFontSize_pixels = $textFontSize.to_f * font_size_factor @@ -342,6 +372,8 @@ def storeTextShape end $prev_time = $shapeCreationTime end # end xml.g + $originalOriginX = $originX + $originalOriginY = $originY end # end if($shapeCreationTime != $prev_time) end @@ -504,6 +536,10 @@ def processShapesAndClears if $shapeType.eql? "pencil" storePencilShape() + # Process the line shapes. + elsif $shapeType.eql? "line" + storeLineShape() + # Process the rectangle shapes elsif $shapeType.eql? "rectangle" storeRectShape() @@ -560,6 +596,7 @@ $originalOriginY = "NaN" $rectangle_count = 0 $triangle_count = 0 +$pencil_count = 0 $line_count = 0 $ellipse_count = 0 $text_count = 0 @@ -726,3 +763,4 @@ end performance_end = Time.now +