kurento_rails 0.1.1 → 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -7,7 +7,7 @@
7
7
 
8
8
  kurentoRailsHelpers = {}
9
9
 
10
- kurentoRailsHelpers.getRailsUrlFromBrowser = () => "#{location.hostname}/websocket"
10
+ kurentoRailsHelpers.getRailsUrlFromBrowser = () => "#{location.hostname + (if location.port then ':' + location.port else '')}/websocket"
11
11
 
12
12
  kurentoRailsHelpers.generateKurentoVideoUrl = (baseFileLocation, videoName) =>
13
13
  date = new Date()
@@ -78,6 +78,7 @@ class StreamingHelper
78
78
  file_url: file_url
79
79
  sender_rtc: @broadcast.kurentoObjects.webRtcEndpoint.id
80
80
  streaming: true
81
+ $.extend(streamToBroadcast, @broadcast.kurentoObjects.extraDataToSaveToRails) if @broadcast.kurentoObjects.extraDataToSaveToRails
81
82
  @rails_websocket_dispatcher.trigger 'streams.broadcast', streamToBroadcast, save_to_rails_success, save_to_rails_failure
82
83
 
83
84
  #### Broadcast (broadcast)
@@ -90,10 +91,11 @@ class StreamingHelper
90
91
  # - callback: function(error, object); a function you wish to have called upon either successful completion of the streaming setup process, or on the occurence of any errors
91
92
  #
92
93
  # It should probably be noted that this function not only broadcasts, but also records the stream
93
- @broadcast.broadcast = (videoName, videoElement, baseFileLocation = "file:///kurento", callback = null) =>
94
+ @broadcast.broadcast = (videoName, videoElement, baseFileLocation = "file:///kurento", extraDataToSaveToRails, callback) =>
94
95
  @broadcast.kurentoObjects.currentCallback = callback
95
96
  @broadcast.kurentoObjects.baseFileLocation = baseFileLocation
96
97
  @broadcast.kurentoObjects.videoName = videoName
98
+ @broadcast.kurentoObjects.extraDataToSaveToRails = extraDataToSaveToRails
97
99
  return onBroadcastingError("You must pass in a valid video tag") if videoElement is null or $(videoElement).prop("tagName").toLowerCase().trim() is not "video"
98
100
  videoElement = $(videoElement)[0] # a little fix to make this work if they used jquery to get the element
99
101
  options = { localVideo: videoElement }
@@ -216,6 +218,7 @@ class StreamingHelper
216
218
  # callback: function(error, object); The function you want to be called upon successful completion of the playback initiation process, or on error
217
219
  @view.live.startViewing = (stream, videoElement, callback = null) =>
218
220
  @view.live.kurentoObjects.callback = callback
221
+ @view.live.kurentoObjects.videoElement = videoElement
219
222
  return onLiveViewError("You must pass in a valid video tag") if videoElement is null or $(videoElement).prop("tagName").toLowerCase().trim() is not "video"
220
223
  videoElement = $(videoElement)[0]
221
224
  @kurento.getMediaobjectById stream.sender_rtc, (error, webRtcEndpoint) =>
@@ -241,6 +244,9 @@ class StreamingHelper
241
244
  if @view.live.kurentoObjects.webRtcPeer
242
245
  @view.live.kurentoObjects.webRtcPeer.dispose()
243
246
  @view.live.kurentoObjects.webRtcPeer = null
247
+ if @view.live.kurentoObjects.videoElement
248
+ @view.live.kurentoObjects.videoElement.src = ''
249
+ @view.live.kurentoObjects.videoElement = null
244
250
  @view.live.kurentoObjects.pipeline = null if @view.live.kurentoObjects.pipeline
245
251
  @view.live.kurentoObjects.presenterWebRtcEndpoint = null if @view.live.kurentoObjects.presenterWebRtcEndpoint
246
252
  callback() if callback
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kurento_rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Stephenson
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-04-29 00:00:00.000000000 Z
11
+ date: 2016-05-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -111,6 +111,18 @@ files:
111
111
  - Rakefile
112
112
  - bin/console
113
113
  - bin/setup
114
+ - docs/docco.css
115
+ - docs/kurento-rails.html
116
+ - docs/public/fonts/aller-bold.eot
117
+ - docs/public/fonts/aller-bold.ttf
118
+ - docs/public/fonts/aller-bold.woff
119
+ - docs/public/fonts/aller-light.eot
120
+ - docs/public/fonts/aller-light.ttf
121
+ - docs/public/fonts/aller-light.woff
122
+ - docs/public/fonts/roboto-black.eot
123
+ - docs/public/fonts/roboto-black.ttf
124
+ - docs/public/fonts/roboto-black.woff
125
+ - docs/public/stylesheets/normalize.css
114
126
  - kurento_rails.gemspec
115
127
  - lib/generators/kurento_rails/install_generator.rb
116
128
  - lib/generators/kurento_rails/templates/config/events.rb