Skip to content

Commit

Permalink
太累了,不顶了
Browse files Browse the repository at this point in the history
  • Loading branch information
numberwolf committed Dec 19, 2021
1 parent a0885ef commit 29656ee
Show file tree
Hide file tree
Showing 15 changed files with 40 additions and 21 deletions.
2 changes: 2 additions & 0 deletions README.MD
Original file line number Diff line number Diff line change
Expand Up @@ -915,6 +915,8 @@ ffmpeg -ss 20 -t 10 -i ./res/xinxiaomen.mp4 \

| 更新日志 | 内容 |
| ---- | ---- |
| 时间 | 2021/12/19 |
| - | 0.修复 H.264 HLS 回调不响应的问题 |
| 时间 | 2021/12/08 |
| - | 0.修复 H.264 MP4 onReadyShowDone回调问题 |
| 时间 | 2021/12/04 - 凌晨 |
Expand Down
2 changes: 2 additions & 0 deletions README_EN.MD
Original file line number Diff line number Diff line change
Expand Up @@ -906,6 +906,8 @@ ffmpeg -ss 20 -t 10 -i ./res/xinxiaomen.mp4 \

| Update | Content |
| ---- | ---- |
| Time | 2021/12/19 |
| - | 0.Fixed H.264 HLS Callback's problem |
| Time | 2021/12/08 |
| - | 0.Fixed Problem of H.264 MP4 onReadyShowDone Event |
| Time | 2021/12/04 - In the small hours |
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
Expand Up @@ -19,7 +19,7 @@
* Github: https://github.com/numberwolf/h265web.js
*
**********************************************************/
require('./h265webjs-v20211208');
require('./h265webjs-v20211219');
export default class h265webjs {
static createPlayer(videoURL, config) {
return window.new265webjs(videoURL, config);
Expand Down
6 changes: 3 additions & 3 deletions example/dist/dist-play.js

Large diffs are not rendered by default.

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion example/dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
* Github: https://github.com/numberwolf/h265web.js
*
**********************************************************/
require('./h265webjs-v20211208');
require('./h265webjs-v20211219');
export default class h265webjs {
static createPlayer(videoURL, config) {
return window.new265webjs(videoURL, config);
Expand Down

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion example_normal/dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
* Github: https://github.com/numberwolf/h265web.js
*
**********************************************************/
require('./h265webjs-v20211208');
require('./h265webjs-v20211219');
export default class h265webjs {
static createPlayer(videoURL, config) {
return window.new265webjs(videoURL, config);
Expand Down
1 change: 1 addition & 0 deletions example_normal/example.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ window.onload = function() {
//var url = "res/hls/veilside.m3u8";
//var url = "res/hls1/test.m3u8";
//var url = "http://182.61.31.911:8080/live/livestream.flv";
var url = "http://127.0.0.1/live/test/hls.m3u8";

/******** Websocket FLV/TS ********/
// var url = "ws://127.0.0.1/live/test.flv";
Expand Down
2 changes: 1 addition & 1 deletion example_normal/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
<link rel="stylesheet" type="text/css" href='player-view/css/progress.css'>
<script src="dist/missile.js"></script> <!-- IMPORTANT -->
<!--<script src="dist/missile-256mb-v20211104.js"></script>--> <!-- wasm for 265mb memory(with grow) -->
<script src="dist/h265webjs-v20211208.js"></script> <!-- IMPORTANT -->
<script src="dist/h265webjs-v20211219.js"></script> <!-- IMPORTANT -->
<script src="example.js"></script> <!-- IMPORTANT -->
<style>
</style>
Expand Down
13 changes: 8 additions & 5 deletions src/src/h265webjs.js
Original file line number Diff line number Diff line change
Expand Up @@ -520,6 +520,7 @@ class H265webjsModule {
fullScreen() {
this.autoScreenClose = true;

console.log("js debug fullScreen => ", this.player.vCodecID, this.player);
if (this.player.vCodecID === def.V_CODEC_NAME_HEVC) {
let glCanvasBox = document
.querySelector('#' + this.configFormat.playerId);
Expand Down Expand Up @@ -1271,7 +1272,6 @@ class H265webjsModule {
// };
let controller = new AbortController();
let signal = controller.signal;
// let isReportNetworkErr = true;

let playerConfig = {
width: this.configFormat.playerW,
Expand Down Expand Up @@ -1859,15 +1859,15 @@ class H265webjsModule {
}
_this.hlsObj = null;

_this.playParam.durationMs = -1;
_this.playParam.durationMs = durationMs;
_this.playParam.fps = fps;
_this.playParam.sampleRate = sampleRate;
_this.playParam.size = size;
_this.playParam.audioNone = aCodec == "";
_this.playParam.videoCodec = isHevcParam ? 0 : 1;
console.log("this.playParam: ", _this.playParam);
console.log("this.playParam: ", _this.playParam, durationMs);
// _this.onLoadFinish && _this.onLoadFinish();
_this._videoJsPlayer(); // videojs
_this._videoJsPlayer(durationMs); // videojs
return;
} // end is hevc

Expand Down Expand Up @@ -1896,9 +1896,10 @@ class H265webjsModule {
}; // end onSamples

// videojs
_videoJsPlayer() {
_videoJsPlayer(probeDurationMS=-1) {
let _this = this;
let playerConfig = {
probeDurationMS: probeDurationMS,
width: this.configFormat.playerW,
height: this.configFormat.playerH,
playerId: this.configFormat.playerId,
Expand All @@ -1922,6 +1923,8 @@ class H265webjsModule {
_this.playMode = def.PLAYER_MODE_VOD
}

console.log("vjs _this.playParam.", _this.playParam, _this.player.duration, _this.player.getSize());

_this.onLoadFinish && _this.onLoadFinish();
}; // onLoadFinish
this.player.onReadyShowDone = () => {
Expand Down
2 changes: 1 addition & 1 deletion src/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
* Github: https://github.com/numberwolf/h265web.js
*
**********************************************************/
require('./h265webjs-v20211208');
require('./h265webjs-v20211219');
export default class h265webjs {
static createPlayer(videoURL, config) {
return window.new265webjs(videoURL, config);
Expand Down
19 changes: 15 additions & 4 deletions src/src/native/nv-videojs-core.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ const videojs = require('video.js');
class NvVideojsCoreModule {
constructor(config) {
this.configFormat = {
probeDurationMS: config.probeDurationMS || -1,
width: config.width || def.DEFAULT_WIDTH,
height: config.height || def.DEFAULT_HEIGHT,
playerId: config.playerId || def.DEFAILT_WEBGL_PLAY_ID,
Expand Down Expand Up @@ -94,10 +95,10 @@ class NvVideojsCoreModule {
this.videoTag.style.width = this.configFormat.width + 'px';
this.videoTag.style.height = this.configFormat.height + 'px';

console.log("this.videoTag==>", this.videoTag);


this.duration = this.myPlayer.duration();
alert("duration:" + this.duration === Infinity);
console.log("this.videoTag==>", this.videoTag, this.duration);

// this.onLoadFinish && this.onLoadFinish();
// this.onReadyShowDone && this.onReadyShowDone();
Expand Down Expand Up @@ -154,11 +155,19 @@ class NvVideojsCoreModule {
alert("load vjs");
_this.myPlayer.on("canplaythrough", function() {
console.log("视频源数据加载完成");
// if (_this.configFormat.probeDurationMS > 0) {
// _this.onLoadFinish && _this.onLoadFinish();
// _this.onReadyShowDone && _this.onReadyShowDone();
// }
});
//myPlayer.play();
_this.myPlayer.on("loadedmetadata", function() {
console.log("vjs loadedmetadata");
_this._onVideoJsReady();
if (_this.configFormat.probeDurationMS > 0) {
_this.onLoadFinish && _this.onLoadFinish();
_this.onReadyShowDone && _this.onReadyShowDone();
}
});
_this.myPlayer.on("ended", function() {
_this.pause();
Expand All @@ -173,8 +182,10 @@ class NvVideojsCoreModule {
});
// _this.play();
_this.onMakeItReady && _this.onMakeItReady();
_this.onLoadFinish && _this.onLoadFinish();
_this.onReadyShowDone && _this.onReadyShowDone();
if (_this.configFormat.probeDurationMS < 0) {
_this.onLoadFinish && _this.onLoadFinish();
_this.onReadyShowDone && _this.onReadyShowDone();
}
});
this.myPlayer.options.controls = false;
// this.myPlayer.options.autoplay = 'any';
Expand Down
2 changes: 1 addition & 1 deletion src/version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@
# * Github: https://github.com/numberwolf/h265web.js
# *
# **********************************************************/
VERSION='v20211208' # output version + index.js
VERSION='v20211219' # output version + index.js

0 comments on commit 29656ee

Please sign in to comment.