mirror of
https://github.com/photonstorm/phaser
synced 2024-11-16 01:38:23 +00:00
Fix docs and lint errors #5374
This commit is contained in:
parent
b86d500fa4
commit
c603db23ce
1 changed files with 10 additions and 6 deletions
|
@ -857,7 +857,7 @@ var Video = new Class({
|
|||
|
||||
return this;
|
||||
},
|
||||
|
||||
|
||||
/**
|
||||
* Loads a Video from the given MediaStream object, ready for playback with the `Video.play` method.
|
||||
*
|
||||
|
@ -865,8 +865,8 @@ var Video = new Class({
|
|||
* the `loadEvent` parameter. See https://developer.mozilla.org/en-US/docs/Web/API/HTMLVideoElement
|
||||
* for more details.
|
||||
*
|
||||
* @method Phaser.GameObjects.Video#loadURL
|
||||
* @since 3.20.0
|
||||
* @method Phaser.GameObjects.Video#loadMediaStream
|
||||
* @since 3.50.0
|
||||
*
|
||||
* @param {string} stream - The MediaStream object.
|
||||
* @param {string} [loadEvent='loadeddata'] - The load event to listen for. Either `loadeddata`, `canplay` or `canplaythrough`.
|
||||
|
@ -874,7 +874,8 @@ var Video = new Class({
|
|||
*
|
||||
* @return {this} This Video Game Object for method chaining.
|
||||
*/
|
||||
loadMediaStream: function(stream, loadEvent, noAudio) {
|
||||
loadMediaStream: function (stream, loadEvent, noAudio)
|
||||
{
|
||||
if (loadEvent === undefined) { loadEvent = 'loadeddata'; }
|
||||
if (noAudio === undefined) { noAudio = false; }
|
||||
|
||||
|
@ -905,9 +906,12 @@ var Video = new Class({
|
|||
|
||||
video.addEventListener('error', this._callbacks.error, true);
|
||||
|
||||
try {
|
||||
try
|
||||
{
|
||||
video.srcObject = stream;
|
||||
} catch (error) {
|
||||
}
|
||||
catch (error)
|
||||
{
|
||||
video.src = window.URL.createObjectURL(stream);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue