Skip to content

Commit

Permalink
Add support for custom source
Browse files Browse the repository at this point in the history
  • Loading branch information
nulltask authored Feb 14, 2017
1 parent b20cf1a commit c099c0f
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 c099c0f

Please sign in to comment.