瀏覽代碼

Merge pull request #127 from nulltask/patch-1

Dominic Szablewski 9 年之前
父節點
當前提交
c032764a0a
共有 1 個文件被更改,包括 5 次插入1 次删除
  1. 5 1
      src/player.js

+ 5 - 1
src/player.js 查看文件

@@ -3,7 +3,11 @@ JSMpeg.Player = (function(){ "use strict";
3 3
 var Player = function(url, options) {
4 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 11
 		this.source = new JSMpeg.Source.WebSocket(url, options);
8 12
 		options.streaming = true;
9 13
 	}