
41 changed files with 231 additions and 3380 deletions
-
31.vuepress/components/renderer.js
-
22.vuepress/public/ff.js
-
2.vuepress/public/ff_wasm.js
-
BIN.vuepress/public/ff_wasm.wasm
-
18.vuepress/public/libhevc_aac.js
-
2.vuepress/public/libhevc_aac_wasm.js
-
BIN.vuepress/public/libhevc_aac_wasm.wasm
-
53Jessibuca.cpp
-
159Jessibuca.js
-
3make.py
-
19public/264_aac.js
-
1public/264_aac_wasm.js
-
BINpublic/264_aac_wasm.wasm
-
17public/264_mp3.js
-
1public/264_mp3_wasm.js
-
BINpublic/264_mp3_wasm.wasm
-
535public/ajax.js
-
16public/avc.js
-
20public/cocos.js
-
1public/ff.js
-
BINpublic/ff.wasm
-
200public/ff_aac.html
-
28public/ff_aac.js
-
1public/ff_aac_wasm.js
-
BINpublic/ff_aac_wasm.wasm
-
200public/ff_mp3.html
-
26public/ff_mp3.js
-
1public/ff_mp3_wasm.js
-
BINpublic/ff_mp3_wasm.wasm
-
1public/ff_wasm.js
-
BINpublic/ff_wasm.wasm
-
1public/flash.html
-
20public/hevc.js
-
199public/hevc_aac.html
-
22public/hevc_aac.js
-
21public/hevc_mp3.js
-
239public/index.html
-
23public/libde265_aac.js
-
20public/libde265_mp3.js
-
BINpublic/live_test.swf
-
1709public/renderer.js
22
.vuepress/public/ff.js
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
2
.vuepress/public/ff_wasm.js
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
18
.vuepress/public/libhevc_aac.js
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
2
.vuepress/public/libhevc_aac_wasm.js
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
19
public/264_aac.js
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
1
public/264_aac_wasm.js
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
17
public/264_mp3.js
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
1
public/264_mp3_wasm.js
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
@ -1,535 +0,0 @@ |
|||
// a simple ajax
|
|||
!(function () { |
|||
|
|||
var jsonType = 'application/json'; |
|||
var htmlType = 'text/html'; |
|||
var xmlTypeRE = /^(?:text|application)\/xml/i; |
|||
var blankRE = /^\s*$/; // \s
|
|||
|
|||
/* |
|||
* default setting |
|||
* */ |
|||
var _settings = { |
|||
|
|||
type: "GET", |
|||
|
|||
beforeSend: noop, |
|||
|
|||
success: noop, |
|||
|
|||
error: noop, |
|||
|
|||
complete: noop, |
|||
|
|||
context: null, |
|||
|
|||
xhr: function () { |
|||
return new window.XMLHttpRequest(); |
|||
}, |
|||
|
|||
accepts: { |
|||
json: jsonType, |
|||
xml: 'application/xml, text/xml', |
|||
html: htmlType, |
|||
text: 'text/plain' |
|||
}, |
|||
|
|||
crossDomain: false, |
|||
|
|||
timeout: 0, |
|||
|
|||
username: null, |
|||
|
|||
password: null, |
|||
|
|||
processData: true, |
|||
|
|||
promise: noop |
|||
}; |
|||
|
|||
function noop() { |
|||
} |
|||
|
|||
var ajax = function (options) { |
|||
|
|||
//
|
|||
var settings = extend({}, options || {}); |
|||
|
|||
//
|
|||
for (var key in _settings) { |
|||
if (settings[key] === undefined) { |
|||
settings[key] = _settings[key]; |
|||
} |
|||
} |
|||
|
|||
//
|
|||
try { |
|||
var q = {}; |
|||
var promise = new Promise(function (resolve, reject) { |
|||
q.resolve = resolve; |
|||
q.reject = reject; |
|||
}); |
|||
|
|||
promise.resolve = q.resolve; |
|||
promise.reject = q.reject; |
|||
|
|||
settings.promise = promise; |
|||
} |
|||
catch (e) { |
|||
//
|
|||
settings.promise = { |
|||
resolve: noop, |
|||
reject: noop |
|||
}; |
|||
} |
|||
|
|||
|
|||
//
|
|||
if (!settings.crossDomain) { |
|||
settings.crossDomain = /^([\w-]+:)?\/\/([^\/]+)/.test(settings.url) && RegExp.$2 !== window.location.href; |
|||
} |
|||
|
|||
var dataType = settings.dataType; |
|||
// jsonp
|
|||
if (dataType === 'jsonp') { |
|||
//
|
|||
var hasPlaceholder = /=\?/.test(settings.url); |
|||
if (!hasPlaceholder) { |
|||
var jsonpCallback = (settings.jsonp || 'callback') + '=?'; |
|||
|
|||
settings.url = appendQuery(settings.url, jsonpCallback) |
|||
} |
|||
return JSONP(settings); |
|||
} |
|||
|
|||
// url
|
|||
if (!settings.url) { |
|||
settings.url = window.location.toString(); |
|||
} |
|||
|
|||
//
|
|||
serializeData(settings); |
|||
|
|||
var mime = settings.accepts[dataType]; // mime
|
|||
var baseHeader = {}; // header
|
|||
var protocol = /^([\w-]+:)\/\//.test(settings.url) ? RegExp.$1 : window.location.protocol; // protocol
|
|||
var xhr = _settings.xhr(); |
|||
var abortTimeout; |
|||
|
|||
// X-Requested-With header
|
|||
// For cross-domain requests, seeing as conditions for a preflight are
|
|||
// akin to a jigsaw puzzle, we simply never set it to be sure.
|
|||
// (it can always be set on a per-request basis or even using ajaxSetup)
|
|||
// For same-domain requests, won't change header if already provided.
|
|||
if (!settings.crossDomain && !baseHeader['X-Requested-With']) { |
|||
baseHeader['X-Requested-With'] = 'XMLHttpRequest'; |
|||
} |
|||
|
|||
// mime
|
|||
if (mime) { |
|||
//
|
|||
baseHeader['Accept'] = mime; |
|||
|
|||
if (mime.indexOf(',') > -1) { |
|||
mime = mime.split(',', 2)[0] |
|||
} |
|||
//
|
|||
xhr.overrideMimeType && xhr.overrideMimeType(mime); |
|||
} |
|||
|
|||
// contentType
|
|||
if (settings.contentType || (settings.data && settings.type.toUpperCase() !== 'GET')) { |
|||
baseHeader['Content-Type'] = (settings.contentType || 'application/x-www-form-urlencoded; charset=UTF-8'); |
|||
} |
|||
|
|||
// headers
|
|||
settings.headers = extend(baseHeader, settings.headers || {}); |
|||
|
|||
// on ready state change
|
|||
xhr.onreadystatechange = function () { |
|||
// readystate
|
|||
if (xhr.readyState === 4) { |
|||
clearTimeout(abortTimeout); |
|||
var result; |
|||
var error = false; |
|||
//
|
|||
if ((xhr.status >= 200 && xhr.status < 300) || xhr.status === 304) { |
|||
dataType = dataType || mimeToDataType(xhr.getResponseHeader('content-type')); |
|||
result = xhr.responseText; |
|||
|
|||
try { |
|||
// xml
|
|||
if (dataType === 'xml') { |
|||
result = xhr.responseXML; |
|||
} |
|||
// json
|
|||
else if (dataType === 'json') { |
|||
result = blankRE.test(result) ? null : JSON.parse(result); |
|||
} |
|||
} |
|||
catch (e) { |
|||
error = e; |
|||
} |
|||
|
|||
if (error) { |
|||
ajaxError(error, 'parseerror', xhr, settings); |
|||
} |
|||
else { |
|||
ajaxSuccess(result, xhr, settings); |
|||
} |
|||
} |
|||
else { |
|||
ajaxError(null, 'error', xhr, settings); |
|||
} |
|||
|
|||
} |
|||
}; |
|||
|
|||
// async
|
|||
var async = 'async' in settings ? settings.async : true; |
|||
|
|||
// open
|
|||
xhr.open(settings.type, settings.url, async, settings.username, settings.password); |
|||
|
|||
// xhrFields
|
|||
if (settings.xhrFields) { |
|||
for (var name in settings.xhrFields) { |
|||
xhr[name] = settings.xhrFields[name]; |
|||
} |
|||
} |
|||
|
|||
// Override mime type if needed
|
|||
if (settings.mimeType && xhr.overrideMimeType) { |
|||
xhr.overrideMimeType(settings.mimeType); |
|||
} |
|||
|
|||
|
|||
// set request header
|
|||
for (var name in settings.headers) { |
|||
// Support: IE<9
|
|||
// IE's ActiveXObject throws a 'Type Mismatch' exception when setting
|
|||
// request header to a null-value.
|
|||
//
|
|||
// To keep consistent with other XHR implementations, cast the value
|
|||
// to string and ignore `undefined`.
|
|||
if (settings.headers[name] !== undefined) { |
|||
xhr.setRequestHeader(name, settings.headers[name] + ""); |
|||
} |
|||
} |
|||
|
|||
// before send
|
|||
if (ajaxBeforeSend(xhr, settings) === false) { |
|||
xhr.abort(); |
|||
return false; |
|||
} |
|||
|
|||
// timeout
|
|||
if (settings.timeout > 0) { |
|||
abortTimeout = window.setTimeout(function () { |
|||
xhr.onreadystatechange = noop; |
|||
xhr.abort(); |
|||
ajaxError(null, 'timeout', xhr, settings); |
|||
}, settings.timeout); |
|||
} |
|||
|
|||
// send
|
|||
xhr.send(settings.data ? settings.data : null); |
|||
|
|||
return settings.promise; |
|||
}; |
|||
|
|||
/* |
|||
* method get |
|||
* */ |
|||
ajax.get = function (url, data, success, dataType) { |
|||
if (isFunction(data)) { |
|||
dataType = dataType || success; |
|||
success = data; |
|||
data = undefined; |
|||
} |
|||
|
|||
return ajax({ |
|||
url: url, |
|||
data: data, |
|||
success: success, |
|||
dataType: dataType |
|||
}); |
|||
}; |
|||
|
|||
/* |
|||
* method post |
|||
* |
|||
* dataType: |
|||
* */ |
|||
ajax.post = function (url, data, success, dataType) { |
|||
if (isFunction(data)) { |
|||
dataType = dataType || success; |
|||
success = data; |
|||
data = undefined; |
|||
} |
|||
return ajax({ |
|||
type: 'POST', |
|||
url: url, |
|||
data: data, |
|||
success: success, |
|||
dataType: dataType |
|||
}) |
|||
}; |
|||
|
|||
/* |
|||
* method getJSON |
|||
* */ |
|||
ajax.getJSON = function (url, data, success) { |
|||
|
|||
if (isFunction(data)) { |
|||
success = data; |
|||
data = undefined; |
|||
} |
|||
|
|||
return ajax({ |
|||
url: url, |
|||
data: data, |
|||
success: success, |
|||
dataType: 'json' |
|||
}) |
|||
}; |
|||
|
|||
/* |
|||
* method ajaxSetup |
|||
* */ |
|||
ajax.ajaxSetup = function (target, settings) { |
|||
return settings ? extend(extend(target, _settings), settings) : extend(_settings, target); |
|||
}; |
|||
|
|||
/* |
|||
* utils |
|||
* |
|||
* */ |
|||
|
|||
|
|||
// triggers and extra global event ajaxBeforeSend that's like ajaxSend but cancelable
|
|||
function ajaxBeforeSend(xhr, settings) { |
|||
var context = settings.context; |
|||
//
|
|||
if (settings.beforeSend.call(context, xhr, settings) === false) { |
|||
return false; |
|||
} |
|||
} |
|||
|
|||
// ajax success
|
|||
function ajaxSuccess(data, xhr, settings) { |
|||
var context = settings.context; |
|||
var status = 'success'; |
|||
settings.success.call(context, data, status, xhr); |
|||
settings.promise.resolve(data, status, xhr); |
|||
ajaxComplete(status, xhr, settings); |
|||
} |
|||
|
|||
// status: "success", "notmodified", "error", "timeout", "abort", "parsererror"
|
|||
function ajaxComplete(status, xhr, settings) { |
|||
var context = settings.context; |
|||
settings.complete.call(context, xhr, status); |
|||
} |
|||
|
|||
// type: "timeout", "error", "abort", "parsererror"
|
|||
function ajaxError(error, type, xhr, settings) { |
|||
var context = settings.context; |
|||
settings.error.call(context, xhr, type, error); |
|||
settings.promise.reject(xhr, type, error); |
|||
ajaxComplete(type, xhr, settings); |
|||
} |
|||
|
|||
|
|||
// jsonp
|
|||
/* |
|||
* tks: https://www.cnblogs.com/rubylouvre/archive/2011/02/13/1953087.html
|
|||
* */ |
|||
function JSONP(options) { |
|||
//
|
|||
var callbackName = options.jsonpCallback || 'jsonp' + (new Date().getTime()); |
|||
|
|||
var script = window.document.createElement('script'); |
|||
|
|||
var abort = function () { |
|||
// 设置 window.xxx = noop
|
|||
if (callbackName in window) { |
|||
window[callbackName] = noop; |
|||
} |
|||
}; |
|||
|
|||
var xhr = {abort: abort}; |
|||
var abortTimeout; |
|||
|
|||
var head = window.document.getElementsByTagName('head')[0] || window.document.documentElement; |
|||
|
|||
// ie8+
|
|||
script.onerror = function (error) { |
|||
_error(error); |
|||
}; |
|||
|
|||
function _error(error) { |
|||
window.clearTimeout(abortTimeout); |
|||
xhr.abort(); |
|||
ajaxError(error.type, xhr, error.type, options); |
|||
_removeScript(); |
|||
} |
|||
|
|||
window[callbackName] = function (data) { |
|||
window.clearTimeout(abortTimeout); |
|||
ajaxSuccess(data, xhr, options); |
|||
_removeScript(); |
|||
}; |
|||
|
|||
//
|
|||
serializeData(options); |
|||
|
|||
script.src = options.url.replace(/=\?/, '=' + callbackName); |
|||
//
|
|||
script.src = appendQuery(script.src, '_=' + (new Date()).getTime()); |
|||
//
|
|||
script.async = true; |
|||
|
|||
// script charset
|
|||
if (options.scriptCharset) { |
|||
script.charset = options.scriptCharset; |
|||
} |
|||
|
|||
//
|
|||
head.insertBefore(script, head.firstChild); |
|||
|
|||
//
|
|||
if (options.timeout > 0) { |
|||
abortTimeout = window.setTimeout(function () { |
|||
xhr.abort(); |
|||
ajaxError('timeout', xhr, 'timeout', options); |
|||
_removeScript(); |
|||
}, options.timeout); |
|||
} |
|||
|
|||
// remove script
|
|||
function _removeScript() { |
|||
if (script.clearAttributes) { |
|||
script.clearAttributes(); |
|||
} else { |
|||
script.onload = script.onreadystatechange = script.onerror = null; |
|||
} |
|||
|
|||
if (script.parentNode) { |
|||
script.parentNode.removeChild(script); |
|||
} |
|||
//
|
|||
script = null; |
|||
|
|||
delete window[callbackName]; |
|||
} |
|||
|
|||
return options.promise; |
|||
} |
|||
|
|||
// mime to data type
|
|||
function mimeToDataType(mime) { |
|||
return mime && (mime === htmlType ? 'html' : mime === jsonType ? 'json' : xmlTypeRE.test(mime) && 'xml') || 'text' |
|||
} |
|||
|
|||
// append query
|
|||
function appendQuery(url, query) { |
|||
return (url + '&' + query).replace(/[&?]{1,2}/, '?'); |
|||
} |
|||
|
|||
// serialize data
|
|||
function serializeData(options) { |
|||
// formData
|
|||
if (isObject(options) && !isFormData(options.data) && options.processData) { |
|||
options.data = param(options.data); |
|||
} |
|||
|
|||
if (options.data && (!options.type || options.type.toUpperCase() === 'GET')) { |
|||
options.url = appendQuery(options.url, options.data); |
|||
} |
|||
} |
|||
|
|||
// serialize
|
|||
function serialize(params, obj, traditional, scope) { |
|||
var _isArray = isArray(obj); |
|||
|
|||
for (var key in obj) { |
|||
var value = obj[key]; |
|||
|
|||
if (scope) { |
|||
key = traditional ? scope : scope + '[' + (_isArray ? '' : key) + ']'; |
|||
} |
|||
|
|||
// handle data in serializeArray format
|
|||
if (!scope && _isArray) { |
|||
params.add(value.name, value.value); |
|||
|
|||
} |
|||
else if (traditional ? _isArray(value) : isObject(value)) { |
|||
serialize(params, value, traditional, key); |
|||
} |
|||
else { |
|||
params.add(key, value); |
|||
} |
|||
} |
|||
|
|||
} |
|||
|
|||
// param
|
|||
function param(obj, traditional) { |
|||
var params = []; |
|||
//
|
|||
params.add = function (k, v) { |
|||
this.push(encodeURIComponent(k) + '=' + encodeURIComponent(v)); |
|||
}; |
|||
serialize(params, obj, traditional); |
|||
return params.join('&').replace('%20', '+'); |
|||
} |
|||
|
|||
// extend
|
|||
function extend(target) { |
|||
var slice = Array.prototype.slice; |
|||
var args = slice.call(arguments, 1); |
|||
//
|
|||
for (var i = 0, length = args.length; i < length; i++) { |
|||
var source = args[i] || {}; |
|||
for (var key in source) { |
|||
if (source.hasOwnProperty(key) && source[key] !== undefined) { |
|||
target[key] = source[key]; |
|||
} |
|||
} |
|||
} |
|||
|
|||
return target; |
|||
} |
|||
|
|||
// is object
|
|||
function isObject(obj) { |
|||
var type = typeof obj; |
|||
return type === 'function' || type === 'object' && !!obj; |
|||
} |
|||
|
|||
// is formData
|
|||
function isFormData(obj) { |
|||
return obj instanceof FormData; |
|||
} |
|||
|
|||
// is array
|
|||
function isArray(value) { |
|||
return Object.prototype.toString.call(value) === "[object Array]"; |
|||
} |
|||
|
|||
// is function
|
|||
function isFunction(value) { |
|||
return typeof value === "function"; |
|||
} |
|||
|
|||
// browser
|
|||
window.ajax = ajax; |
|||
})(); |
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
16
public/avc.js
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
20
public/cocos.js
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
1
public/ff.js
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
@ -1,200 +0,0 @@ |
|||
<!DOCTYPE html> |
|||
<html> |
|||
|
|||
<head> |
|||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> |
|||
<title>Jessibuca 1.0</title> |
|||
<meta charset="utf-8" /> |
|||
<style> |
|||
.btn { |
|||
display: inline-block; |
|||
line-height: 1; |
|||
white-space: nowrap; |
|||
cursor: pointer; |
|||
-webkit-appearance: none; |
|||
text-align: center; |
|||
box-sizing: border-box; |
|||
outline: none; |
|||
margin: 0; |
|||
transition: .1s; |
|||
font-weight: 500; |
|||
-moz-user-select: none; |
|||
-webkit-user-select: none; |
|||
-ms-user-select: none; |
|||
padding: 12px 20px; |
|||
font-size: 14px; |
|||
border-radius: 4px; |
|||
color: #fff; |
|||
background-color: #409eff; |
|||
border-color: #409eff; |
|||
width: 100%; |
|||
} |
|||
|
|||
.btn-danger { |
|||
color: #fff; |
|||
background-color: #f56c6c; |
|||
border-color: #f56c6c; |
|||
} |
|||
|
|||
.btn-success { |
|||
color: #fff; |
|||
background-color: #67c23a; |
|||
border-color: #67c23a; |
|||
} |
|||
|
|||
.player-wrapper { |
|||
width: 900px; |
|||
height: 500px; |
|||
/*overflow-y: auto;*/ |
|||
margin: 0 auto; |
|||
text-align: center; |
|||
} |
|||
|
|||
.btn-wrapper { |
|||
width: 900px; |
|||
height: 50px; |
|||
margin: 0 auto; |
|||
margin-top: 10px; |
|||
} |
|||
|
|||
.player-wrapper canvas { |
|||
width: 100%; |
|||
height: 100%; |
|||
} |
|||
|
|||
.logs { |
|||
border: 1px solid #333; |
|||
width: 900px; |
|||
height: 300px; |
|||
margin: 0 auto; |
|||
overflow-y: auto; |
|||
padding: 5px; |
|||
} |
|||
</style> |
|||
</head> |
|||
|
|||
<body> |
|||
<div class="player-wrapper"> |
|||
<canvas id="canvas" style="background-color: #0D0E1B"></canvas> |
|||
</div> |
|||
<div class="btn-wrapper"> |
|||
<div id="playDom"> |
|||
<button class="btn" id="play">播放</button> |
|||
</div> |
|||
<div id="stopDom" style="display: none"> |
|||
<button class="btn btn-danger" id="stop">结束</button> |
|||
</div> |
|||
</div> |
|||
|
|||
<div id="logout" class="logs"> |
|||
</div> |
|||
|
|||
<script src="./ajax.js"></script> |
|||
<script> |
|||
onerror = handleErr; |
|||
var txt = ""; |
|||
var h5lc = null; |
|||
var $play = document.getElementById('play'); |
|||
var $stop = document.getElementById('stop'); |
|||
var $playDom = document.getElementById('playDom'); |
|||
var $stopDom = document.getElementById('stopDom'); |
|||
var canvas = document.getElementById("canvas"); |
|||
var isPlaying = false; |
|||
disabledMouseWheel(canvas); |
|||
|
|||
$play.addEventListener('click', function () { |
|||
if (isPlaying) { |
|||
return; |
|||
} |
|||
isPlaying = true; |
|||
play(); |
|||
$playDom.style.display = 'none'; |
|||
$stopDom.style.display = 'block'; |
|||
}); |
|||
|
|||
$stop.addEventListener('click', function () { |
|||
if (!isPlaying) { |
|||
return; |
|||
} |
|||
|
|||
isPlaying = false; |
|||
stop(); |
|||
|
|||
$playDom.style.display = 'block'; |
|||
$stopDom.style.display = 'none'; |
|||
}); |
|||
|
|||
function play() { |
|||
// h5lc.play("ws://10.24.13.58:8088/live/user1.flv", canvas) |
|||
//h5lc.play("ws://3.1.39.135:8080/live/3458", canvas) |
|||
h5lc.play("ws://localhost/live/user1",canvas) |
|||
// h5lc.play("ws://119.9.118.39:8080/live/user1", canvas) |
|||
// h5lc.play("ws://test.qihaipi.com/gnddragon/test.flv", canvas) |
|||
} |
|||
|
|||
function stop() { |
|||
h5lc.close() |
|||
} |
|||
|
|||
function disabledMouseWheel(ele) { |
|||
if (ele.addEventListener) { |
|||
ele.addEventListener('DOMMouseScroll', scrollFunc, false); |
|||
} //W3C |
|||
ele.onmousewheel = scrollFunc; //IE/Opera/Chrome |
|||
} |
|||
|
|||
function scrollFunc(evt) { |
|||
evt = evt || window.event; |
|||
if (evt.preventDefault) { |
|||
// Firefox |
|||
evt.preventDefault(); |
|||
evt.stopPropagation(); |
|||
} else { |
|||
// IE |
|||
evt.cancelBubble = true; |
|||
evt.returnValue = false; |
|||
} |
|||
return false; |
|||
} |
|||
|
|||
function handleErr(msg, url, l) { |
|||
txt = "There was an error on this page.\n\n"; |
|||
txt += "Error: " + msg + "\n"; |
|||
txt += "URL: " + url + "\n"; |
|||
txt += "Line: " + l + "\n\n"; |
|||
document.getElementById("logout").innerHTML += txt + "<br>"; |
|||
return true; |
|||
} |
|||
|
|||
var Module = { |
|||
print: (function () { |
|||
return function (text) { |
|||
if (arguments.length > 1) text = Array.prototype.slice.call(arguments).join(' '); |
|||
document.getElementById("logout").innerHTML += text + "<br>"; |
|||
// These replacements are necessary if you render to raw HTML |
|||
//text = text.replace(/&/g, "&"); |
|||
//text = text.replace(/</g, "<"); |
|||
//text = text.replace(/>/g, ">"); |
|||
//text = text.replace('\n', '<br>', 'g'); |
|||
console.log(text); |
|||
}; |
|||
})(), |
|||
printErr: function (text) { |
|||
if (arguments.length > 1) text = Array.prototype.slice.call(arguments).join(' '); |
|||
document.getElementById("logout").innerHTML += text + "<br>"; |
|||
if (0) { // XXX disabled for safety typeof dump == 'function') { |
|||
dump(text + '\n'); // fast, straight to the real console |
|||
} else { |
|||
console.error(text); |
|||
} |
|||
}, |
|||
postRun: function () { |
|||
h5lc = new Jessibuca(); |
|||
h5lc.videoBuffer = 1; |
|||
} |
|||
}; |
|||
</script> |
|||
<script src="./ff_aac.js"></script> |
|||
</body> |
|||
|
|||
</html> |
28
public/ff_aac.js
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
1
public/ff_aac_wasm.js
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
@ -1,200 +0,0 @@ |
|||
<!DOCTYPE html> |
|||
<html> |
|||
|
|||
<head> |
|||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> |
|||
<title>H5LiveClient 1.0</title> |
|||
<meta charset="utf-8" /> |
|||
<style> |
|||
.btn { |
|||
display: inline-block; |
|||
line-height: 1; |
|||
white-space: nowrap; |
|||
cursor: pointer; |
|||
-webkit-appearance: none; |
|||
text-align: center; |
|||
box-sizing: border-box; |
|||
outline: none; |
|||
margin: 0; |
|||
transition: .1s; |
|||
font-weight: 500; |
|||
-moz-user-select: none; |
|||
-webkit-user-select: none; |
|||
-ms-user-select: none; |
|||
padding: 12px 20px; |
|||
font-size: 14px; |
|||
border-radius: 4px; |
|||
color: #fff; |
|||
background-color: #409eff; |
|||
border-color: #409eff; |
|||
width: 100%; |
|||
} |
|||
|
|||
.btn-danger { |
|||
color: #fff; |
|||
background-color: #f56c6c; |
|||
border-color: #f56c6c; |
|||
} |
|||
|
|||
.btn-success { |
|||
color: #fff; |
|||
background-color: #67c23a; |
|||
border-color: #67c23a; |
|||
} |
|||
|
|||
.player-wrapper { |
|||
width: 900px; |
|||
height: 500px; |
|||
/*overflow-y: auto;*/ |
|||
margin: 0 auto; |
|||
text-align: center; |
|||
} |
|||
|
|||
.btn-wrapper { |
|||
width: 900px; |
|||
height: 50px; |
|||
margin: 0 auto; |
|||
margin-top: 10px; |
|||
} |
|||
|
|||
/* |
|||
.player-wrapper canvas { |
|||
width: 100%; |
|||
height: 100%; |
|||
} */ |
|||
|
|||
.logs { |
|||
border: 1px solid #333; |
|||
width: 900px; |
|||
height: 300px; |
|||
margin: 0 auto; |
|||
overflow-y: auto; |
|||
padding: 5px; |
|||
} |
|||
</style> |
|||
</head> |
|||
|
|||
<body> |
|||
<div class="player-wrapper"> |
|||
<canvas id="canvas" style="background-color: #0D0E1B" width="900" height="500"></canvas> |
|||
</div> |
|||
<div class="btn-wrapper"> |
|||
<div id="playDom"> |
|||
<button class="btn" id="play">播放</button> |
|||
</div> |
|||
<div id="stopDom" style="display: none"> |
|||
<button class="btn btn-danger" id="stop">结束</button> |
|||
</div> |
|||
</div> |
|||
|
|||
<div id="logout" class="logs"> |
|||
</div> |
|||
|
|||
<script src="./ajax.js"></script> |
|||
<script> |
|||
onerror = handleErr; |
|||
var txt = ""; |
|||
var h5lc = null; |
|||
var $play = document.getElementById('play'); |
|||
var $stop = document.getElementById('stop'); |
|||
var $playDom = document.getElementById('playDom'); |
|||
var $stopDom = document.getElementById('stopDom'); |
|||
var canvas = document.getElementById("canvas"); |
|||
var isPlaying = false; |
|||
disabledMouseWheel(canvas); |
|||
|
|||
$play.addEventListener('click', function () { |
|||
if (isPlaying) { |
|||
return; |
|||
} |
|||
isPlaying = true; |
|||
play(); |
|||
$playDom.style.display = 'none'; |
|||
$stopDom.style.display = 'block'; |
|||
}); |
|||
|
|||
$stop.addEventListener('click', function () { |
|||
if (!isPlaying) { |
|||
return; |
|||
} |
|||
|
|||
isPlaying = false; |
|||
stop(); |
|||
|
|||
$playDom.style.display = 'block'; |
|||
$stopDom.style.display = 'none'; |
|||
}); |
|||
|
|||
function play() { |
|||
h5lc.play("ws://3.1.39.135:8080/live/345.flv", canvas) |
|||
// h5lc.play("ws://localhost:8080/live/user1", canvas) |
|||
// h5lc.play("ws://119.9.118.39:8080/live/user1", canvas) |
|||
// h5lc.play("ws://test.qihaipi.com/gnddragon/test.flv", canvas) |
|||
} |
|||
|
|||
function stop() { |
|||
h5lc.close() |
|||
} |
|||
|
|||
function disabledMouseWheel(ele) { |
|||
if (ele.addEventListener) { |
|||
ele.addEventListener('DOMMouseScroll', scrollFunc, false); |
|||
} //W3C |
|||
ele.onmousewheel = scrollFunc; //IE/Opera/Chrome |
|||
} |
|||
|
|||
function scrollFunc(evt) { |
|||
evt = evt || window.event; |
|||
if (evt.preventDefault) { |
|||
// Firefox |
|||
evt.preventDefault(); |
|||
evt.stopPropagation(); |
|||
} else { |
|||
// IE |
|||
evt.cancelBubble = true; |
|||
evt.returnValue = false; |
|||
} |
|||
return false; |
|||
} |
|||
|
|||
function handleErr(msg, url, l) { |
|||
txt = "There was an error on this page.\n\n"; |
|||
txt += "Error: " + msg + "\n"; |
|||
txt += "URL: " + url + "\n"; |
|||
txt += "Line: " + l + "\n\n"; |
|||
document.getElementById("logout").innerHTML += txt + "<br>"; |
|||
return true; |
|||
} |
|||
|
|||
var Module = { |
|||
print: (function () { |
|||
return function (text) { |
|||
if (arguments.length > 1) text = Array.prototype.slice.call(arguments).join(' '); |
|||
document.getElementById("logout").innerHTML += text + "<br>"; |
|||
// These replacements are necessary if you render to raw HTML |
|||
//text = text.replace(/&/g, "&"); |
|||
//text = text.replace(/</g, "<"); |
|||
//text = text.replace(/>/g, ">"); |
|||
//text = text.replace('\n', '<br>', 'g'); |
|||
console.log(text); |
|||
}; |
|||
})(), |
|||
printErr: function (text) { |
|||
if (arguments.length > 1) text = Array.prototype.slice.call(arguments).join(' '); |
|||
document.getElementById("logout").innerHTML += text + "<br>"; |
|||
if (0) { // XXX disabled for safety typeof dump == 'function') { |
|||
dump(text + '\n'); // fast, straight to the real console |
|||
} else { |
|||
console.error(text); |
|||
} |
|||
}, |
|||
postRun: function () { |
|||
h5lc = new H5LiveClient(); |
|||
h5lc.videoBuffer = 1; |
|||
} |
|||
}; |
|||
</script> |
|||
<script src="./ff_mp3.js"></script> |
|||
</body> |
|||
|
|||
</html> |
26
public/ff_mp3.js
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
1
public/ff_mp3_wasm.js
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
1
public/ff_wasm.js
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
@ -1 +0,0 @@ |
|||
<embed src="live_test.swf" width="1024" height="768"></embed> |
20
public/hevc.js
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
@ -1,199 +0,0 @@ |
|||
<!DOCTYPE html> |
|||
<html> |
|||
|
|||
<head> |
|||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> |
|||
<title>H5LiveClient 1.0</title> |
|||
<meta charset="utf-8" /> |
|||
<style> |
|||
.btn { |
|||
display: inline-block; |
|||
line-height: 1; |
|||
white-space: nowrap; |
|||
cursor: pointer; |
|||
-webkit-appearance: none; |
|||
text-align: center; |
|||
box-sizing: border-box; |
|||
outline: none; |
|||
margin: 0; |
|||
transition: .1s; |
|||
font-weight: 500; |
|||
-moz-user-select: none; |
|||
-webkit-user-select: none; |
|||
-ms-user-select: none; |
|||
padding: 12px 20px; |
|||
font-size: 14px; |
|||
border-radius: 4px; |
|||
color: #fff; |
|||
background-color: #409eff; |
|||
border-color: #409eff; |
|||
width: 100%; |
|||
} |
|||
|
|||
.btn-danger { |
|||
color: #fff; |
|||
background-color: #f56c6c; |
|||
border-color: #f56c6c; |
|||
} |
|||
|
|||
.btn-success { |
|||
color: #fff; |
|||
background-color: #67c23a; |
|||
border-color: #67c23a; |
|||
} |
|||
|
|||
.player-wrapper { |
|||
width: 900px; |
|||
height: 500px; |
|||
/*overflow-y: auto;*/ |
|||
margin: 0 auto; |
|||
text-align: center; |
|||
} |
|||
|
|||
.btn-wrapper { |
|||
width: 900px; |
|||
height: 50px; |
|||
margin: 0 auto; |
|||
margin-top: 10px; |
|||
} |
|||
|
|||
.player-wrapper canvas { |
|||
width: 100%; |
|||
height: 100%; |
|||
} |
|||
|
|||
.logs { |
|||
border: 1px solid #333; |
|||
width: 900px; |
|||
height: 300px; |
|||
margin: 0 auto; |
|||
overflow-y: auto; |
|||
padding: 5px; |
|||
} |
|||
</style> |
|||
</head> |
|||
|
|||
<body> |
|||
<div class="player-wrapper"> |
|||
<canvas id="canvas" style="background-color: #0D0E1B"></canvas> |
|||
</div> |
|||
<div class="btn-wrapper"> |
|||
<div id="playDom"> |
|||
<button class="btn" id="play">播放</button> |
|||
</div> |
|||
<div id="stopDom" style="display: none"> |
|||
<button class="btn btn-danger" id="stop">结束</button> |
|||
</div> |
|||
</div> |
|||
|
|||
<div id="logout" class="logs"> |
|||
</div> |
|||
|
|||
<script src="./ajax.js"></script> |
|||
<script> |
|||
onerror = handleErr; |
|||
var txt = ""; |
|||
var h5lc = null; |
|||
var $play = document.getElementById('play'); |
|||
var $stop = document.getElementById('stop'); |
|||
var $playDom = document.getElementById('playDom'); |
|||
var $stopDom = document.getElementById('stopDom'); |
|||
var canvas = document.getElementById("canvas"); |
|||
var isPlaying = false; |
|||
disabledMouseWheel(canvas); |
|||
|
|||
$play.addEventListener('click', function () { |
|||
if (isPlaying) { |
|||
return; |
|||
} |
|||
isPlaying = true; |
|||
play(); |
|||
$playDom.style.display = 'none'; |
|||
$stopDom.style.display = 'block'; |
|||
}); |
|||
|
|||
$stop.addEventListener('click', function () { |
|||
if (!isPlaying) { |
|||
return; |
|||
} |
|||
|
|||
isPlaying = false; |
|||
stop(); |
|||
|
|||
$playDom.style.display = 'block'; |
|||
$stopDom.style.display = 'none'; |
|||
}); |
|||
|
|||
function play() { |
|||
h5lc.play("ws://3.1.39.135:8080/live/345.flv", canvas) |
|||
// h5lc.play("ws://localhost:8080/live/user1", canvas) |
|||
// h5lc.play("ws://119.9.118.39:8080/live/user1", canvas) |
|||
// h5lc.play("ws://test.qihaipi.com/gnddragon/test.flv", canvas) |
|||
} |
|||
|
|||
function stop() { |
|||
h5lc.close() |
|||
} |
|||
|
|||
function disabledMouseWheel(ele) { |
|||
if (ele.addEventListener) { |
|||
ele.addEventListener('DOMMouseScroll', scrollFunc, false); |
|||
} //W3C |
|||
ele.onmousewheel = scrollFunc; //IE/Opera/Chrome |
|||
} |
|||
|
|||
function scrollFunc(evt) { |
|||
evt = evt || window.event; |
|||
if (evt.preventDefault) { |
|||
// Firefox |
|||
evt.preventDefault(); |
|||
evt.stopPropagation(); |
|||
} else { |
|||
// IE |
|||
evt.cancelBubble = true; |
|||
evt.returnValue = false; |
|||
} |
|||
return false; |
|||
} |
|||
|
|||
function handleErr(msg, url, l) { |
|||
txt = "There was an error on this page.\n\n"; |
|||
txt += "Error: " + msg + "\n"; |
|||
txt += "URL: " + url + "\n"; |
|||
txt += "Line: " + l + "\n\n"; |
|||
document.getElementById("logout").innerHTML += txt + "<br>"; |
|||
return true; |
|||
} |
|||
|
|||
var Module = { |
|||
print: (function () { |
|||
return function (text) { |
|||
if (arguments.length > 1) text = Array.prototype.slice.call(arguments).join(' '); |
|||
document.getElementById("logout").innerHTML += text + "<br>"; |
|||
// These replacements are necessary if you render to raw HTML |
|||
//text = text.replace(/&/g, "&"); |
|||
//text = text.replace(/</g, "<"); |
|||
//text = text.replace(/>/g, ">"); |
|||
//text = text.replace('\n', '<br>', 'g'); |
|||
console.log(text); |
|||
}; |
|||
})(), |
|||
printErr: function (text) { |
|||
if (arguments.length > 1) text = Array.prototype.slice.call(arguments).join(' '); |
|||
document.getElementById("logout").innerHTML += text + "<br>"; |
|||
if (0) { // XXX disabled for safety typeof dump == 'function') { |
|||
dump(text + '\n'); // fast, straight to the real console |
|||
} else { |
|||
console.error(text); |
|||
} |
|||
}, |
|||
postRun: function () { |
|||
h5lc = new H5LiveClient(); |
|||
h5lc.videoBuffer = 1; |
|||
} |
|||
}; |
|||
</script> |
|||
<script src="./hevc_aac.js"></script> |
|||
</body> |
|||
|
|||
</html> |
22
public/hevc_aac.js
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
21
public/hevc_mp3.js
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
@ -1,239 +0,0 @@ |
|||
<!DOCTYPE html> |
|||
<html> |
|||
|
|||
<head> |
|||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> |
|||
<title>Jessibuca 1.0</title> |
|||
<meta charset="utf-8" /> |
|||
<style> |
|||
.btn { |
|||
display: inline-block; |
|||
line-height: 1; |
|||
white-space: nowrap; |
|||
cursor: pointer; |
|||
-webkit-appearance: none; |
|||
text-align: center; |
|||
box-sizing: border-box; |
|||
outline: none; |
|||
margin: 0; |
|||
transition: .1s; |
|||
font-weight: 500; |
|||
-moz-user-select: none; |
|||
-webkit-user-select: none; |
|||
-ms-user-select: none; |
|||
padding: 12px 20px; |
|||
font-size: 14px; |
|||
border-radius: 4px; |
|||
color: #fff; |
|||
background-color: #409eff; |
|||
border-color: #409eff; |
|||
width: 100%; |
|||
} |
|||
|
|||
.btn-danger { |
|||
color: #fff; |
|||
background-color: #f56c6c; |
|||
border-color: #f56c6c; |
|||
} |
|||
|
|||
.btn-success { |
|||
color: #fff; |
|||
background-color: #67c23a; |
|||
border-color: #67c23a; |
|||
} |
|||
|
|||
.player-wrapper { |
|||
width: 900px; |
|||
height: 500px; |
|||
/*overflow-y: auto;*/ |
|||
margin: 0 auto; |
|||
text-align: center; |
|||
} |
|||
|
|||
.btn-wrapper { |
|||
width: 900px; |
|||
height: 50px; |
|||
margin: 0 auto; |
|||
margin-top: 10px; |
|||
} |
|||
|
|||
/*.player-wrapper canvas {*/ |
|||
/* width: 100%;*/ |
|||
/* height: 100%;*/ |
|||
/*}*/ |
|||
|
|||
.logs { |
|||
border: 1px solid #333; |
|||
width: 900px; |
|||
height: 300px; |
|||
margin: 0 auto; |
|||
overflow-y: auto; |
|||
padding: 5px; |
|||
} |
|||
</style> |
|||
</head> |
|||
|
|||
<body> |
|||
<div class="player-wrapper" id="container" style="background-color: #0D0E1B;width:900px;height:500px"> |
|||
</div> |
|||
<div class="btn-wrapper" id="playDom"> |
|||
<button class="btn" id="play">播放</button> |
|||
</div> |
|||
<div class="btn-wrapper btn-wrapper2" id="stopDom" style="display: none"> |
|||
<div style="margin-top: 5px"> |
|||
<button class="btn btn-danger" id="stop">结束</button> |
|||
</div> |
|||
</div> |
|||
<button class="btn" onclick="h5lc.fullscreen=true">全屏</button> |
|||
<div id="logout" class="logs"> |
|||
</div> |
|||
|
|||
<script src="./ajax.js"></script> |
|||
<script src="./renderer.js"></script> |
|||
<script> |
|||
onerror = handleErr; |
|||
var txt = ""; |
|||
window.onkeydown = function () { |
|||
h5lc.fullscreen = false |
|||
} |
|||
var $play = document.getElementById('play'); |
|||
var $stop = document.getElementById('stop'); |
|||
var $playDom = document.getElementById('playDom'); |
|||
var $stopDom = document.getElementById('stopDom'); |
|||
var container = document.getElementById("container"); |
|||
var isPlaying = false; |
|||
disabledMouseWheel(container); |
|||
let stream = queryParam('stream') || 'user1'; |
|||
let decoder = queryParam('decoder') || 'ff'; |
|||
let source = queryParam('source') || 'localhost'; |
|||
var h5lc = new Jessibuca({ container, decoder: decoder + ".js", videoBuffer: 0 }); |
|||
|
|||
h5lc.onLoad = function () { |
|||
//this.play("wss://pulls.1234326.cn/live/L01.flv") |
|||
//this.play("ws://localhost:8080/live/rtc.flv") |
|||
//this.play("ws://" + source + ":8080/live/" + stream) |
|||
//this.play("ws://pull3.afb1188.com/live/" + stream + ".flv") |
|||
//this.play("ws://pull2.afb1188.com/live/" + stream + ".flv") |
|||
} |
|||
h5lc.onPlay = function () { |
|||
isPlaying = true; |
|||
$playDom.style.display = 'none'; |
|||
$stopDom.style.display = 'block'; |
|||
} |
|||
$play.addEventListener('click', function () { |
|||
if (isPlaying) { |
|||
return; |
|||
} |
|||
isPlaying = true; |
|||
play(); |
|||
$playDom.style.display = 'none'; |
|||
$stopDom.style.display = 'block'; |
|||
}, false); |
|||
|
|||
$stop.addEventListener('click', function () { |
|||
if (!isPlaying) { |
|||
return; |
|||
} |
|||
|
|||
isPlaying = false; |
|||
stop(); |
|||
|
|||
$playDom.style.display = 'block'; |
|||
$stopDom.style.display = 'none'; |
|||
}, false); |
|||
|
|||
|
|||
function play(firstResponseIp) { |
|||
//h5lc.play("ws://" + (firstResponseIp || source) + ":8080/live/" + stream) |
|||
//h5lc.play("ws://pull2.afb1188.com/live/" + stream + ".flv") |
|||
h5lc.play("ws://localhost:8080/live/" + stream) |
|||
// h5lc.play("ws://119.9.118.39:8080/live/user1", canvas) |
|||
// h5lc.play("ws://test.qihaipi.com/gnddragon/test.flv", canvas) |
|||
} |
|||
function getFastCdnFromList(ipList) { |
|||
ipList = ipList || []; |
|||
var firstResponseIp = ''; |
|||
|
|||
for (var i = 0, len = ipList.length; i < len; i++) { |
|||
var tempIp = ipList[i].name; |
|||
var reqHref = 'http://' + tempIp + '/test'; |
|||
var request = _ajax.get(reqHref); |
|||
request.then(function (data) { |
|||
if (!firstResponseIp) { |
|||
firstResponseIp = tempIp; |
|||
// 直接可以播放了。 |
|||
play(firstResponseIp); |
|||
} |
|||
}) |
|||
} |
|||
} |
|||
function stop() { |
|||
h5lc.close() |
|||
} |
|||
|
|||
function queryParam(name, url) { |
|||
var search = window.location.search; |
|||
var qArr = ''; |
|||
var key = {}; |
|||
|
|||
if (url) { |
|||
qArr = url.split("?")[1].split("&") |
|||
|
|||
} else { |
|||
if (!window.location.search) { |
|||
return |
|||
} |
|||
qArr = search.substr(1).split("&") |
|||
} |
|||
|
|||
for (var i = 0; i < qArr.length; i++) { |
|||
|
|||
var firstPos = qArr[i].indexOf('='); |
|||
key[qArr[i].slice(0, firstPos)] = qArr[i].slice(firstPos + 1) |
|||
} |
|||
|
|||
if (name) { |
|||
return key[name] |
|||
} else { |
|||
if (url) { |
|||
return key[name] |
|||
} else { |
|||
return key |
|||
} |
|||
} |
|||
} |
|||
|
|||
function disabledMouseWheel(ele) { |
|||
if (ele.addEventListener) { |
|||
ele.addEventListener('DOMMouseScroll', scrollFunc, false); |
|||
} //W3C |
|||
ele.onmousewheel = scrollFunc; //IE/Opera/Chrome |
|||
} |
|||
|
|||
function scrollFunc(evt) { |
|||
evt = evt || window.event; |
|||
if (evt.preventDefault) { |
|||
// Firefox |
|||
evt.preventDefault(); |
|||
evt.stopPropagation(); |
|||
} else { |
|||
// IE |
|||
evt.cancelBubble = true; |
|||
evt.returnValue = false; |
|||
} |
|||
return false; |
|||
} |
|||
|
|||
function handleErr(msg, url, l) { |
|||
txt = "There was an error on this page.\n\n"; |
|||
txt += "Error: " + msg + "\n"; |
|||
txt += "URL: " + url + "\n"; |
|||
txt += "Line: " + l + "\n\n"; |
|||
document.getElementById("logout").innerHTML += txt + "<br>"; |
|||
return true; |
|||
} |
|||
</script> |
|||
|
|||
</body> |
|||
|
|||
</html> |
23
public/libde265_aac.js
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
20
public/libde265_mp3.js
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
1709
public/renderer.js
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
Write
Preview
Loading…
Cancel
Save
Reference in new issue