Selaa lähdekoodia

Merge pull request #127 from nulltask/patch-1

Dominic Szablewski 9 vuotta sitten
vanhempi
commit
c032764a0a
1 muutettua tiedostoa jossa 5 lisäystä ja 1 poistoa
  1. 5 1
      src/player.js

+ 5 - 1
src/player.js Näytä tiedosto

3
 var Player = function(url, options) {
3
 var Player = function(url, options) {
4
 	this.options = options || {};
4
 	this.options = options || {};
5
 
5
 
6
-	if (url.match(/^wss?:\/\//)) {
6
+	if (options.source) {
7
+		this.source = new options.source(url, options);
8
+		options.streaming = !!this.source.streaming;
9
+	}
10
+	else if (url.match(/^wss?:\/\//)) {
7
 		this.source = new JSMpeg.Source.WebSocket(url, options);
11
 		this.source = new JSMpeg.Source.WebSocket(url, options);
8
 		options.streaming = true;
12
 		options.streaming = true;
9
 	}
13
 	}