Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Now getUserMedia and createObjectURL detection actually works.

  • Loading branch information...
commit 008ffbbb133aedba01795b485b36dc0bf8e98b95 1 parent ceabd55
@alejandro authored
Showing with 10 additions and 2 deletions.
  1. +10 −2 videostreaming-demo/broadcast-bundle.js
View
12 videostreaming-demo/broadcast-bundle.js
@@ -3359,10 +3359,12 @@ function MediaStream(options) {
this.readable = true
var getUserMedia = me.getGetUserMedia()
if (!getUserMedia) return console.log({"error": "getUserMedia not supported in this browser"})
- navigator.webkitGetUserMedia(options,
+ getUserMedia(options,
function(stream) {
var video = me.video = me.createHiddenVideo()
- video.src = window.webkitURL.createObjectURL(stream)
+ var URL = me.URL()
+ if (!URL) return console.log({"error":"createObjectURL not supported in this browser"})
+ video.src = URL.createObjectURL(stream)
video.play()
},
function(err) {
@@ -3385,6 +3387,12 @@ MediaStream.prototype.getGetUserMedia = function() {
return false
}
+MediaStream.prototype.URL = function() {
+ if (window.URL) return window.URL
+ if (window.webkitURL) return window.webkitURL
+ return false
+}
+
MediaStream.prototype.onVideoPlay = function() {
var video = this.video
if (!isNaN(video.duration)) {
Please sign in to comment.
Something went wrong with that request. Please try again.