Skip to content

Commit c603db2

Browse files
committed
Fix docs and lint errors phaserjs#5374
1 parent b86d500 commit c603db2

1 file changed

Lines changed: 10 additions & 6 deletions

File tree

src/gameobjects/video/Video.js

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -857,24 +857,25 @@ var Video = new Class({
857857

858858
return this;
859859
},
860-
860+
861861
/**
862862
* Loads a Video from the given MediaStream object, ready for playback with the `Video.play` method.
863863
*
864864
* You can control at what point the browser determines the video as being ready for playback via
865865
* the `loadEvent` parameter. See https://developer.mozilla.org/en-US/docs/Web/API/HTMLVideoElement
866866
* for more details.
867867
*
868-
* @method Phaser.GameObjects.Video#loadURL
869-
* @since 3.20.0
868+
* @method Phaser.GameObjects.Video#loadMediaStream
869+
* @since 3.50.0
870870
*
871871
* @param {string} stream - The MediaStream object.
872872
* @param {string} [loadEvent='loadeddata'] - The load event to listen for. Either `loadeddata`, `canplay` or `canplaythrough`.
873873
* @param {boolean} [noAudio=false] - Does the video have an audio track? If not you can enable auto-playing on it.
874874
*
875875
* @return {this} This Video Game Object for method chaining.
876876
*/
877-
loadMediaStream: function(stream, loadEvent, noAudio) {
877+
loadMediaStream: function (stream, loadEvent, noAudio)
878+
{
878879
if (loadEvent === undefined) { loadEvent = 'loadeddata'; }
879880
if (noAudio === undefined) { noAudio = false; }
880881

@@ -905,9 +906,12 @@ var Video = new Class({
905906

906907
video.addEventListener('error', this._callbacks.error, true);
907908

908-
try {
909+
try
910+
{
909911
video.srcObject = stream;
910-
} catch (error) {
912+
}
913+
catch (error)
914+
{
911915
video.src = window.URL.createObjectURL(stream);
912916
}
913917

0 commit comments

Comments
 (0)