File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -207,7 +207,7 @@ Phaser.Device = function () {
207207 * @property {boolean } getUserMedia - Does the device support the getUserMedia API?
208208 * @default
209209 */
210- this . getUserMedia = false ;
210+ this . getUserMedia = true ;
211211
212212 /**
213213 * @property {boolean } quirksMode - Is the browser running in strict mode (false) or quirks mode? (true)
@@ -699,7 +699,20 @@ Phaser.Device._initialize = function () {
699699
700700 device . quirksMode = ( document . compatMode === 'CSS1Compat' ) ? false : true ;
701701
702- device . getUserMedia = ! ! ( navigator . getUserMedia || navigator . webkitGetUserMedia || navigator . mozGetUserMedia || navigator . msGetUserMedia ) ;
702+ navigator . getUserMedia = navigator . getUserMedia || navigator . webkitGetUserMedia || navigator . mozGetUserMedia || navigator . msGetUserMedia ;
703+
704+ window . URL = window . URL || window . webkitURL || window . mozURL || window . msURL ;
705+
706+ device . getUserMedia = device . getUserMedia && ! ! navigator . getUserMedia && ! ! window . URL ;
707+
708+ // Older versions of firefox (< 21) apparently claim support but user media does not actually work
709+ if ( navigator . userAgent . match ( / F i r e f o x \D + ( \d + ) / ) )
710+ {
711+ if ( parseInt ( RegExp . $1 , 10 ) < 21 )
712+ {
713+ device . getUserMedia = false ;
714+ }
715+ }
703716
704717 // TODO: replace canvasBitBltShift detection with actual feature check
705718
You can’t perform that action at this time.
0 commit comments