Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/support h266 #1096

Open
wants to merge 97 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
97 commits
Select commit Hold shift + click to select a range
2770c2c
bvc2 codec support
Aug 30, 2023
cab6f2d
fix: 🐛 (xgplayer-mp4-loader) 修复MP4重播时卡帧及卡顿问题
gemxx Nov 20, 2023
62e261c
release: [email protected]
gemxx Nov 20, 2023
95a8eb3
fix: 🐛 (xgplayer-transmuxer) 修复MP4音画不同步问题
gemxx Dec 19, 2023
6354948
fix: 🐛 (xgplayer-mp4-loader) 修复MP4音画不同步问题
gemxx Dec 27, 2023
b9d3e12
fix: 🐛 (xgplayer-transmuxer) eslint rule
gemxx Dec 27, 2023
1fc44ec
release: [email protected]
gemxx Dec 27, 2023
01394c7
release: [email protected]
gemxx Dec 27, 2023
aa7210f
refactor: 💡 (xgplayer-mp4-loader) update transmuxer version
gemxx Dec 27, 2023
fd70ea2
release: [email protected]
gemxx Dec 27, 2023
eb0f2c3
fix: 🐛 (xgplayer-mp4-loader) 默认MP4修复edts时间偏移
gemxx Dec 27, 2023
d78eaa1
release: [email protected]
gemxx Dec 27, 2023
c80bc65
fix: 🐛 (xgplayer-mp4-loader) 调整新方案,修复MP4音画不同步问题
gemxx Jan 18, 2024
8de17e2
release: [email protected]
gemxx Jan 18, 2024
1496555
refactor: 💡 (xgplayer-mp4-loader) 更新依赖版本
gemxx Jan 18, 2024
d5fc1ef
release: [email protected]
gemxx Jan 18, 2024
277e861
fix: 🐛 (xgplayer-mp4-loader) 修复 M75+ 之前的版本对于负的 dts 开播报错问题
gemxx Jan 23, 2024
8d852b6
release: [email protected]
gemxx Jan 23, 2024
a020629
refactor: 💡 (xgplayer-mp4-loader) 更新依赖版本
gemxx Jan 23, 2024
f370349
release: [email protected]
gemxx Jan 23, 2024
b23635c
fix: 🐛 (xgplayer-transmuxer) 修复media_time为负数时,解析数值逻辑不正确导致开播失败问题
gemxx Jan 30, 2024
ba8f596
release: [email protected]
gemxx Jan 30, 2024
f59bfdb
refactor: 💡 (xgplayer-mp4-loader) 更新依赖版本
gemxx Jan 30, 2024
6d5b382
release: [email protected]
gemxx Jan 30, 2024
9d1820b
refactor: 💡 (xgplayer-mp4-loader) 调整音频分组策略
gemxx Mar 29, 2024
32d73fc
release: [email protected]
gemxx Mar 29, 2024
a132ae1
refactor: 💡 (xgplayer-mp4-loader) 重构音频分组策略
gemxx Apr 9, 2024
45f4de1
release: [email protected]
gemxx Apr 9, 2024
32569ea
refactor: 💡 (xgplayer-mp4-loader) 调整音频分组策略
gemxx Apr 9, 2024
3b24b3b
release: [email protected]
gemxx Apr 9, 2024
837a38d
fix(mp4-loader): 修复stsc.entries为控诉组解析异常问题
hongqx Apr 15, 2024
06bd208
release: [email protected]
hongqx Apr 15, 2024
ec7ffc3
refactor: 💡 (xgplayer-mp4-loader) 为config参数增加默认值
gemxx May 8, 2024
ac4455e
fix push cause crash
May 17, 2024
e5fdd37
release: [email protected]
May 17, 2024
e26784f
release: [email protected]
May 17, 2024
85f5cd7
release: [email protected]
May 21, 2024
a0dccfc
release: [email protected]
May 21, 2024
1d142ed
fix push oom
May 27, 2024
9dc1992
release: [email protected]
May 27, 2024
6e13e17
release: [email protected]
May 27, 2024
8e51113
release: [email protected]
May 28, 2024
7ce55a8
getCTTSOffset fix
May 28, 2024
59adb0c
release: [email protected]
May 28, 2024
f4aefe8
release: [email protected]
May 28, 2024
69dd6f7
fix Uint8Array failed
May 30, 2024
5bbb588
release: [email protected]
May 30, 2024
d46e820
release: [email protected]
May 30, 2024
ff711be
release: [email protected]
May 30, 2024
32039bf
release: [email protected]
May 30, 2024
40e8694
release: [email protected]
May 30, 2024
25b3643
release: [email protected]
May 30, 2024
8881dc3
release: [email protected]
May 30, 2024
b36ba82
fix memory use
May 31, 2024
1c2efb9
release: [email protected]
May 31, 2024
6dbdb8c
release: [email protected]
May 31, 2024
623a65f
release: [email protected]
May 31, 2024
ac4b521
release: [email protected]
May 31, 2024
30b466e
release: [email protected]
May 31, 2024
380defa
release: [email protected]
May 31, 2024
76f4b9f
fix: 🐛 (xgplayer-mp4-loader) 修复加密视频,视频时长数值超大问题
gemxx May 31, 2024
8b44e6e
refactor: 💡 (xgplayer-mp4-loader) 优化GOP内识别frame关键帧的性能以及内存
gemxx Jun 4, 2024
f14e2d3
delete stss box
May 31, 2024
d243882
release: [email protected]
May 31, 2024
e138a2f
release: [email protected]
May 31, 2024
459abd6
release: [email protected]
Jun 3, 2024
94dd8a1
release: [email protected]
Jun 3, 2024
76db1d8
release: [email protected]
Jun 3, 2024
ee26539
release: [email protected]
Jun 3, 2024
79c5d9b
release: [email protected]
Jun 3, 2024
b3e8935
release: [email protected]
Jun 3, 2024
09695ea
add memoryOpt control
Jun 4, 2024
6126563
release: [email protected]
Jun 4, 2024
026b173
release: [email protected]
Jun 5, 2024
cdff45d
release: [email protected]
Jun 5, 2024
be2fc11
fix demux err
Jun 10, 2024
09be873
release: [email protected]
Jun 10, 2024
4b184cf
release: [email protected]
Jun 10, 2024
2871ce4
release: [email protected]
Jun 12, 2024
9aa25ee
release: [email protected]
Jun 12, 2024
599f98a
release: [email protected]
Jul 4, 2024
eb470c5
release: [email protected]
Jul 4, 2024
b74cda4
first frame 优化
Jul 22, 2024
47c2b6b
first frame 优化
Jul 22, 2024
6493a46
release: [email protected]
Jul 22, 2024
a75256b
release: [email protected]
Jul 22, 2024
3ebe041
modfiy demuxPart remainBuffer
Jul 26, 2024
1a64420
release: [email protected]
Jul 26, 2024
82efe2c
release: [email protected]
Jul 26, 2024
b5f799b
loader fix
Aug 1, 2024
b40db23
release: [email protected]
Aug 1, 2024
029a257
fix get segments
Aug 6, 2024
4b365e7
release: [email protected]
Aug 6, 2024
46dd318
release: [email protected]
Aug 20, 2024
5f83256
release: [email protected]
Aug 20, 2024
a5a7b40
release: [email protected]
Aug 20, 2024
f6f8ffc
release: [email protected]
Aug 20, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions fixtures/mp4/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,9 @@
let player = new Player({
id: 'vs',
autoplay: true,
volume: 1,
url: '',
//url: './video/output.m4a',//'./video/1080p.mp4',
volume: 0.2,
// url: 'http://tosv.byted.org/obj/media-fe/badcase/av-not-sync-hevc.mp4',
url: './video/1080p.mp4',//'./video/1080p.mp4',
// url:'https://lf3-static.bytednsdoc.com/obj/eden-cn/nupenuvpxnuvo/xgplayer_doc/xgplayer-demo-720p.mp4',
poster: "//lf3-static.bytednsdoc.com/obj/eden-cn/nupenuvpxnuvo/xgplayer_doc/poster.jpg",
playsinline: true,
Expand All @@ -100,7 +100,12 @@
// },
height: window.innerHeight -300,
width: window.innerWidth,
plugins: [Mp4Plugin]
plugins: [Mp4Plugin],
mp4plugin: {
// enableWorker:true,
disableBufferBreakCheck:true,
memoryOpt:true,
}
});
window.player = player

Expand All @@ -116,7 +121,8 @@
}
window.playNext = playNext
player.on('ended', () => {
player.replay()
console.log('duration:', player.duration)
// player.replay()
})
</script>
<!--<script type="module" src="./index.js"></script>-->
Expand Down
164 changes: 24 additions & 140 deletions fixtures/xgplayer/index.html
Original file line number Diff line number Diff line change
@@ -1,145 +1,29 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="referrer" content="no-referrer" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Document</title>
<script src="https://unpkg.com/vconsole/dist/vconsole.min.js"></script>
<script>
var ua = navigator.userAgent.toLowerCase()
console.log('ua', ua, (ua.indexOf('mobile') > -1 || ua.indexOf('ipad') > -1) && location.href.indexOf('vconsole=1') > -1)
if ((ua.indexOf('mobile') > -1 || ua.indexOf('ipad') > -1) && location.href.indexOf('vconsole=1') > -1) {
var vConsole = new window.VConsole();
}
</script>
<style>
.pannel {
margin: 20px 0;
padding: 20px;
background: #72a0c8;
}
.message-pannel {
margin-top: 20px;
color: #333a3c;
}
.message-info {
margin-top: 20px;
border: 1px solid #728bb8;
padding: 10px 10px;
}
h4 {
margin-block-start: 0.2em;
margin-block-end: 0.2em;
}
p {
line-height: 18px;
display: block;
line-height: 16px;
/* margin: 10px; */
margin-block-start: 0.4em;
margin-block-end: 0.4em;
}
.ext-controls0 {
height: 80px !important;
background-color: #000;
}
.xgplayer .my-pop {
height: 100px;
width: 400px;
background-color: #72a0c8;
border: 2px solid red;
box-sizing: border-box;
}
</style>
</head>
<html>
<head>
<meta charset="utf-8">
<meta name=viewport content="width=device-width,initial-scale=1,maximum-scale=1,minimum-scale=1,user-scalable=no,minimal-ui">
<meta name="referrer" content="no-referrer">
<title>xgplayer</title>
<style type="text/css">
html, body {width:100%;height:100%;margin:auto;overflow: hidden;}
</style>
</head>
<body>
<div id="mse"></div>
<link rel="stylesheet" href="https://unpkg.byted-static.com/xgplayer/3.0.10/dist/index.min.css"/>
<script charset="utf-8" src="https://unpkg.byted-static.com/xgplayer/3.0.10/dist/index.min.js"></script>

<body>
<div id="video0" style="margin: 0 auto"></div>
<div class="pannel">
<div class="tool">
<button type="submit" class="btn" id="js-destroy0" onclick="window.destroy(0)">
销毁
</button>
<button type="submit" class="btn" id="js-reinit0" onclick="window.init(0)">
重新初始化
</button>
<button type="submit" class="btn" id="js-playnext0" onclick="window.playNext(0)">
播放下一个
</button>
<button
type="submit"
class="btn"
id="js-changelang0"
onclick="window.changeLang(0)"
>
切换语言
</button>
<button
type="submit"
class="btn"
id="js-changelang0"
onclick="window.createDot(0)"
>
添加预览点
</button>
</div>
<div class="message-pannel">
<div class="message-info" id="js-show-lang0">
<h4>current lang:</h4>
</div>
<script>
const config = {
"id": "mse",
"url": "https://lf3-static.bytednsdoc.com/obj/eden-cn/7221eh7pxhfuloj/wangziyi5.23.mp4",
"playsinline": true,
"poster": "//lf9-cdn-tos.bytecdntp.com/cdn/expire-1-M/byted-player-videos/1.0.0/poster.jpg",
"plugins": []
}

<div class="message-info" id="js-show-log0">
<h4>log info:</h4>
</div>
</div>
</div>
<div id="video1" style="margin: 0 auto"></div>
<!-- <div class="pannel">
<div class="tool">
<button type="submit" class="btn" id="js-destroy0" onclick="window.destroy(0)">
销毁
</button>
<button type="submit" class="btn" id="js-reinit0" onclick="window.init(0)">
重新初始化
</button>
<button type="submit" class="btn" id="js-playnext0" onclick="window.playNext(0)">
播放下一个
</button>
<button
type="submit"
class="btn"
id="js-changelang0"
onclick="window.changeLang(0)"
>
切换语言
</button>
<button
type="submit"
class="btn"
id="js-changelang0"
onclick="window.createDot(0)"
>
添加预览点
</button>
</div>
<div class="message-pannel">
<div class="message-info" id="js-show-lang0">
<h4>current lang:</h4>
</div>
let player = new Player(config)

<div class="message-info" id="js-show-log0">
<h4>log info:</h4>
</div>
</div>
</div> -->
<script></script>
<script type="module" defer src="./index.js"></script>
<script>
// window.onload = function(){
// window.initPlayer()
// }
</script>
</body>
</script> </body>
</html>
2 changes: 1 addition & 1 deletion fixtures/xgplayer/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ function init(index = 0, config = {}) {
url: url
}
},
url: "",
url: "https://lf3-static.bytednsdoc.com/obj/eden-cn/7221eh7pxhfuloj/wangziyi5.23.mp4",
DynamicBg: {
disable: false
},
Expand Down
8 changes: 4 additions & 4 deletions packages/xgplayer-mp4-loader/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "xgplayer-mp4-loader",
"version": "3.0.11-alpha.10",
"version": "3.0.9-rc.20",
"main": "dist/index.min.js",
"module": "es/index.js",
"typings": "es/index.d.ts",
Expand All @@ -15,15 +15,15 @@
"publishConfig": {
"registry": "https://registry.npmjs.org/",
"access": "public",
"tag": "alpha"
"tag": "rc"
},
"license": "MIT",
"unpkgFiles": [
"dist"
],
"dependencies": {
"xgplayer-transmuxer": "3.0.11-alpha.10",
"xgplayer-streaming-shared": "3.0.11-alpha.10",
"xgplayer-transmuxer": "3.0.9-rc.12",
"xgplayer-streaming-shared": "3.0.11-rc.3",
"eventemitter3": "^4.0.7"
},
"peerDependencies": {
Expand Down
4 changes: 4 additions & 0 deletions packages/xgplayer-mp4-loader/src/config.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
export function getConfig (cfg) {
if (typeof cfg.fixEditListOffset !== 'boolean') {
delete cfg.fixEditListOffset
}
return {
vid: '',
moovEnd: 80000,
segmentDuration: 2,
maxDownloadInfoSize: 30,
responseType: 'arraybuffer',
fixEditListOffset: true,
cache: null,
// ...xgplayer-streaming-shared/src/net/config
...cfg
Expand Down
21 changes: 21 additions & 0 deletions packages/xgplayer-mp4-loader/src/gopItem.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
export default class GopItem {
constructor () {
this.frames = []
this.dur = 0
this.minPts = Number.MAX_VALUE
this.maxPts = 0
}
appendFrame (frame) {
this.frames.push(frame)
this.dur += frame.duration
}
calMinMaxPts (frame) {
if (frame.pts < this.minPts){
this.minPts = frame.pts
}
const pts = frame.pts + frame.duration
if (pts > this.maxPts){
this.maxPts = pts
}
}
}
Loading