Skip to content

Commit

Permalink
Merge pull request phoboslab#127 from nulltask/patch-1
Browse files Browse the repository at this point in the history
Add support for custom source
  • Loading branch information
phoboslab authored Feb 14, 2017
2 parents b20cf1a + c099c0f commit c032764
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/player.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@ JSMpeg.Player = (function(){ "use strict";
var Player = function(url, options) {
this.options = options || {};

if (url.match(/^wss?:\/\//)) {
if (options.source) {
this.source = new options.source(url, options);
options.streaming = !!this.source.streaming;
}
else if (url.match(/^wss?:\/\//)) {
this.source = new JSMpeg.Source.WebSocket(url, options);
options.streaming = true;
}
Expand Down

0 comments on commit c032764

Please sign in to comment.