Skip to content

Commit

Permalink
他开着邻居家的Toyota追着日落
Browse files Browse the repository at this point in the history
  • Loading branch information
numberwolf committed May 18, 2021
1 parent 4d4d283 commit 039902b
Show file tree
Hide file tree
Showing 7 changed files with 68 additions and 13 deletions.
2 changes: 2 additions & 0 deletions README.MD
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@

| 更新日志 | 内容 |
| ---- | ---- |
| 时间 | 2021/05/18 |
| - | 1.HLS(直播)性能优化、增加声音Case |
| 时间 | 2021/05/16 |
| - | 1.MP4点播兼容BD265产出部分特殊box case |
| 时间 | 2021/05/15 |
Expand Down
2 changes: 2 additions & 0 deletions README_EN.MD
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ __`~^_^~ For love` if <a href="https://github.com/numberwolf/h265web.js">h265web

| Update | Content |
| ---- | ---- |
| Time | 2021/05/18 |
| - | 1.HLS(LIVE) performance optimizing and add Audio |
| Time | 2021/05/16 |
| - | 1.MP4(VOD) Fixed:BD265 Mp4 box badcase |
| Time | 2021/05/15 |
Expand Down

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require('./h265webjs-v20210516');
require('./h265webjs-v20210518');
export default class h265webjs {
static createPlayer(videoURL, config) {
return window.new265webjs(videoURL, config);
Expand Down
28 changes: 20 additions & 8 deletions dist/play.js
Original file line number Diff line number Diff line change
Expand Up @@ -23304,10 +23304,7 @@ function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterat
t.playParams.seekEvent && (t.playParams.seekEvent = !1, t.onSeekFinish(), t.isPlaying || (t.playFrameYUV(!0, t.playParams.accurateSeek), t.pause()), t.config.audioNone || t.audio.setVoice(t.realVolume)), t.onPlayingTime && t.onPlayingTime(t.videoPTS), t.checkFinished(t.playParams.mode);
},
play: function play(e) {
t.playParams = e, t.calcuteStartTime = h(), t.noCacheFrame = 0, t.isPlaying = t.playParams.realPlay, t.playParams.mode == f.PLAYER_MODE_NOTIME_LIVE ? (t.frameTime = 1e3 / t.config.fps, t.frameTimeSec = t.frameTime / 1e3, t.loop = window.setInterval(function () {
var e = h();
t.playFrameYUV(!0, t.playParams.accurateSeek), t.preCostTime = h() - e, t.preCostTime;
}, t.frameTime)) : t.videoPTS >= t.playParams.seekPos && !t.isNewSeek || 0 === t.playParams.seekPos || 0 === t.playParams.seekPos ? (t.frameTime = 1e3 / t.config.fps, t.frameTimeSec = t.frameTime / 1e3, 0 == t.config.audioNone && t.audio.play(), t.realVolume = t.config.audioNone ? 0 : t.audio.voice, t.playParams.seekEvent && (t.fix_poc_err_skip = 10), t.loop = window.setInterval(function () {
t.playParams = e, t.calcuteStartTime = h(), t.noCacheFrame = 0, t.isPlaying = t.playParams.realPlay, t.videoPTS >= t.playParams.seekPos && !t.isNewSeek || 0 === t.playParams.seekPos || 0 === t.playParams.seekPos ? (t.frameTime = 1e3 / t.config.fps, t.frameTimeSec = t.frameTime / 1e3, 0 == t.config.audioNone && t.audio.play(), t.realVolume = t.config.audioNone ? 0 : t.audio.voice, t.playParams.seekEvent && (t.fix_poc_err_skip = 10), t.loop = window.setInterval(function () {
var e = h();
t.playFunc(), t.preCostTime = h() - e, t.preCostTime;
}, 1)) : (t.loop = window.setInterval(function () {
Expand Down Expand Up @@ -25048,7 +25045,7 @@ function _defineProperties(target, props) { for (var i = 0; i < props.length; i+

function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }

require('./h265webjs-v20210516');
require('./h265webjs-v20210518');

var h265webjs =
/*#__PURE__*/
Expand Down Expand Up @@ -25076,7 +25073,7 @@ function () {
exports["default"] = h265webjs;

}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
},{"./h265webjs-v20210516":1}],3:[function(require,module,exports){
},{"./h265webjs-v20210518":1}],3:[function(require,module,exports){
"use strict";

Object.defineProperty(exports, "__esModule", {
Expand Down Expand Up @@ -25425,6 +25422,8 @@ global.makeH265webjs = function (videoURL, config) {
var showLabel = document.querySelector('#showLabel');
var ptsLabel = document.querySelector('#ptsLabel');
var fullScreenBtn = document.querySelector('#fullScreenBtn');
var coverToast = document.querySelector('#coverLayer');
var coverBtn = document.querySelector('#coverLayerBtn');
var mediaInfo = null;
playBar.disabled = true;
playBar.textContent = '>';
Expand Down Expand Up @@ -25527,10 +25526,23 @@ global.makeH265webjs = function (videoURL, config) {
progressPts.hidden = true;
cachePts.hidden = true;
ptsLabel.textContent = 'LIVE';
setTimeout(function () {

if (mediaInfo.meta.audioNone === true) {
playBar.textContent = '||';
h265webjs.play();
}, 1000);
} else {
coverToast.removeAttribute('hidden');

coverBtn.onclick = function () {
playBar.textContent = '||';
h265webjs.play();
coverToast.setAttribute('hidden', 'hidden');
};
} //setTimeout(() => {
//playBar.textContent = '||';
//h265webjs.play();
//}, 1000);

}

showLabel.textContent = SHOW_DONE;
Expand Down
25 changes: 24 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,21 @@
body {
background-color: #eeeeee;
}
#coverLayer {
width: 100%;
height: 100%;
padding-top: 300px;
z-index: 10000;
position: absolute;
top: 0px;
left: 0px;
background-color: rgba(0, 0, 0, 0.5);
}
#coverLayerBtn {
width: 20%;
height: 200px;
border-radius: 50px;
}
#controller {
background-color: black;
width: 960px;
Expand Down Expand Up @@ -133,6 +148,12 @@
</head>
<body>

<div id="coverLayer" hidden="hidden">
<center>
<button id="coverLayerBtn"><font size="100px">PLAY</font></button>
</center>
</div>

<h1> h265web.js demo </h1>
<div id="glplayer"></div>
<div id="controller">
Expand Down Expand Up @@ -188,10 +209,12 @@ <h1> h265web.js demo </h1>
// var type = "ts";
// var url = "res/hls/v-000.ts"

// var type = "hls";
//var type = "hls";
// var url = "res/m3u82/cg720phevc.m3u8";
// var url = "res/m3u8/cg.m3u8";
// var url = "res/hls/veilside.m3u8";
//var url = "res/hls/veilside_live.m3u8";
//var url = "res/hls-an/veilside_live.m3u8";
// var url = "res/hls1/test.m3u8";

const PLAYER_CORE_TYPE_DEFAULT = 0; // 默认内核 recommand!!!!!!
Expand Down
20 changes: 18 additions & 2 deletions play.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ global.makeH265webjs = (videoURL, config) => {
let showLabel = document.querySelector('#showLabel');
let ptsLabel = document.querySelector('#ptsLabel');
let fullScreenBtn = document.querySelector('#fullScreenBtn');
let coverToast = document.querySelector('#coverLayer');
let coverBtn = document.querySelector('#coverLayerBtn');
let mediaInfo = null;

playBar.disabled = true;
Expand Down Expand Up @@ -131,10 +133,24 @@ global.makeH265webjs = (videoURL, config) => {
progressPts.hidden = true;
cachePts.hidden = true;
ptsLabel.textContent = 'LIVE';
setTimeout(() => {

if (mediaInfo.meta.audioNone === true) {
playBar.textContent = '||';
h265webjs.play();
}, 1000);
} else {
coverToast.removeAttribute('hidden');
coverBtn.onclick = () => {
playBar.textContent = '||';
h265webjs.play();
coverToast.setAttribute('hidden', 'hidden');
};
}

//setTimeout(() => {
//playBar.textContent = '||';
//h265webjs.play();
//}, 1000);

}

showLabel.textContent = SHOW_DONE;
Expand Down

0 comments on commit 039902b

Please sign in to comment.