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

使用chrome107版本开起硬件加速模式才可以正常播放,播放一阵子随机出现报错 #762

Open
wants to merge 61 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
c7c2fe1
add support for flv h265
nanguantong Sep 20, 2022
10e390b
modify README
nanguantong Sep 20, 2022
c90483e
update README and packet.json
nanguantong Sep 20, 2022
67f7823
update README
nanguantong Sep 20, 2022
b0d18ac
modify h265 codec string
nanguantong Sep 21, 2022
87b1d8c
add features.nativeMP4H265Playback
nanguantong Sep 21, 2022
1ddfc6b
1.6.4
nanguantong Sep 23, 2022
0e95313
fix av obj null bug
nanguantong Sep 26, 2022
0c0c7c4
package.json: Bump to v1.6.7
nanguantong Sep 26, 2022
b290e66
package.json: Bump to v1.6.8
nanguantong Sep 26, 2022
27108e7
1.7.0
nanguantong Sep 29, 2022
c169a55
fix: 修正for循环中i变量声明
duzeng Oct 14, 2022
3211c91
fix: again--!
duzeng Oct 14, 2022
868c5b2
modify README and add supportMSEH265Playback
nanguantong May 28, 2023
6966a71
split avcc and hvcc (not bug)
nanguantong May 28, 2023
1f53d69
Merge pull request #1 from duzeng/h265
nanguantong May 28, 2023
5207fbe
Merge branch 'h265' of https://github.com/nanguantong/flv-h265.js int…
nanguantong May 28, 2023
ae6a7b3
1.7.1
nanguantong May 28, 2023
93c1cb4
modify README
nanguantong May 28, 2023
3079710
modify README
nanguantong May 28, 2023
065cc26
1.7.2
nanguantong May 28, 2023
792e494
add get and set speed
nanguantong Jun 4, 2023
1930cf9
fix param missing
nanguantong Oct 29, 2023
cf79580
add demo event
nanguantong Oct 29, 2023
e78bf74
1.7.3
nanguantong Oct 29, 2023
8a42b81
add PROGRESS event
nanguantong Oct 29, 2023
2501d72
1.7.4
nanguantong Oct 29, 2023
1966629
set checkbox isLive default checked
nanguantong Feb 5, 2024
cd8f1a6
enhanced check h264/h265 supported
nanguantong Feb 5, 2024
8ade204
check null
nanguantong Feb 5, 2024
11c74da
check String.prototype.startsWith() if or not exsited
nanguantong Feb 5, 2024
67f77ea
add missed _abortController inited
nanguantong Feb 5, 2024
ed751b3
modify _stashInitialSize init size 64KB and _bufferSize 3MB at least
nanguantong Feb 5, 2024
4fcd063
modify _speedNormalizeList
nanguantong Feb 5, 2024
e9dfa17
modify live stream: always use 1/8 normalized speed for size of stash…
nanguantong Feb 5, 2024
bfdc49c
add supported mp4 av01 and av1c
nanguantong Feb 5, 2024
79c32a2
check null
nanguantong Feb 5, 2024
4be8264
add PlayerEvents.DESTROYING
nanguantong Feb 5, 2024
080e28e
don't remove progress event
nanguantong Feb 5, 2024
fd65a8f
add START_STREAMING and END_STREAMING mse event
nanguantong Feb 5, 2024
bebe270
add sps parser codec mine type
nanguantong Feb 8, 2024
2a3e937
add hevc sps parser codec mine type
nanguantong Feb 8, 2024
ff49409
add support av1 and flv extended header parser
nanguantong Feb 8, 2024
9fc451a
add check (AVC/HEVC/AV1)DecoderConfigurationRecord if or not changed
nanguantong Feb 8, 2024
087943f
typo
nanguantong Feb 8, 2024
8e3ffb9
remove isComplete partial check
nanguantong Feb 8, 2024
5c1ecf9
add function getTimestampBase
nanguantong Feb 8, 2024
939d30a
extract directSeek
nanguantong Feb 15, 2024
2829215
.
nanguantong Feb 16, 2024
ae6a40f
version 1.7.5
nanguantong Feb 18, 2024
7049cd9
fix calc getBitsLeft
nanguantong Feb 19, 2024
1b2ee92
version 1.7.6
nanguantong Feb 19, 2024
f0ed2cc
update README.md
nanguantong Feb 23, 2024
b4beffc
fixed: stall when unbuffered seek to position 0 with audio codec mp3
nanguantong Apr 9, 2024
348c613
Allow hevc config version to be 0 or 1
nanguantong Apr 9, 2024
2e8ed92
version 1.7.7
nanguantong Apr 9, 2024
f8737fb
fix safari cannot play ts file problem.
nanguantong Jul 6, 2024
3ad740d
Feat: Support Opus in FLV (eFLV v2)
nanguantong Jul 6, 2024
7327f34
Feat: support mp4 generate opus
nanguantong Jul 6, 2024
9a1e557
Fix av1 config check
nanguantong Jul 6, 2024
e6da9f5
Bump to 1.7.8
nanguantong Jul 6, 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
23 changes: 14 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,41 +1,46 @@

flv.js [![npm](https://img.shields.io/npm/v/flv.js.svg?style=flat)](https://www.npmjs.com/package/flv.js)
flv-h265.js [![npm](https://img.shields.io/npm/v/flv-h265.js.svg?style=flat)](https://www.npmjs.com/package/flv-h265.js)
======
An HTML5 Flash Video (FLV) Player written in pure JavaScript without Flash. LONG LIVE FLV!

This project relies on [Media Source Extensions][] to work.

**For FLV live stream playback, please consider [mpegts.js][] which is under active development.**

**This project will become rarely maintained.**
**For FLV live stream playback, please also consider [mpegts.js][] which is under active development.**

[mpegts.js]: https://github.com/xqq/mpegts.js
## Overview
flv.js works by transmuxing FLV file stream into ISO BMFF (Fragmented MP4) segments, followed by feeding mp4 segments into an HTML5 `<video>` element through [Media Source Extensions][] API.

[Media Source Extensions]: https://w3c.github.io/media-source/

## HEVC(H265) Chrome Support
[enable-chromium-hevc-hardware-decoding](https://github.com/StaZhu/enable-chromium-hevc-hardware-decoding)
```
NOTE: the lastest chrome version has been supported HEVC.
```

## Demo
[http://bilibili.github.io/flv.js/demo/](http://bilibili.github.io/flv.js/demo/)

## Features
- FLV container with H.264 + AAC / MP3 codec playback
- FLV container with H.264 / H.265 / AV1 + AAC / MP3 codec playback
- Multipart segmented video playback
- HTTP FLV low latency live stream playback
- FLV over WebSocket live stream playback
- Compatible with Chrome, FireFox, Safari 10, IE11 and Edge
- Extremely low overhead, and hardware accelerated by your browser!
- [Enhanced RTMP](https://github.com/veovera/enhanced-rtmp) with H.265 support for FLV

## Installation
```bash
npm install --save flv.js
npm install --save flv-h265.js
```

## Build
```bash
npm ci # install dependencies / dev-dependences
npm run build:debug # debug version flv.js will be emitted to /dist
npm run build # minimized release version flv.min.js will be emitted to /dist
npm run build:debug # debug version flv-h265.js will be emitted to /dist
npm run build # minimized release version flv-h265.min.js will be emitted to /dist
```

[cnpm](https://github.com/cnpm/cnpm) mirror is recommended if you are in Mainland China.
Expand All @@ -47,7 +52,7 @@ See [cors.md](docs/cors.md) for more details.

## Getting Started
```html
<script src="flv.min.js"></script>
<script src="flv-h265.min.js"></script>
<video id="videoElement"></video>
<script>
if (flvjs.isSupported()) {
Expand Down
1 change: 1 addition & 0 deletions d.ts/flv.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,7 @@ declare namespace FlvJs {
networkStreamIO: boolean;
networkLoaderName: string;
nativeMP4H264Playback: boolean;
nativeMP4H265Playback: boolean;
nativeWebmVP8Playback: boolean;
nativeWebmVP9Playback: boolean;
}
Expand Down
13 changes: 11 additions & 2 deletions demo/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<button onclick="switch_mds()">Switch to MediaDataSource</button>
</div>
<div class="options">
<input type="checkbox" id="isLive" onchange="saveSettings()" />
<input type="checkbox" id="isLive" onchange="saveSettings()" checked />
<label for="isLive">isLive</label>
<input type="checkbox" id="withCredentials" onchange="saveSettings()" />
<label for="withCredentials">withCredentials</label>
Expand Down Expand Up @@ -104,6 +104,15 @@
lazyLoadMaxDuration: 3 * 60,
seekType: 'range',
});
player.on(flvjs.Events.METADATA_ARRIVED, function(data) {
console.log("METADATA_ARRIVED", data)
});
player.on(flvjs.Events.SCRIPTDATA_ARRIVED, function(data) {
console.log("SCRIPTDATA_ARRIVED", data) // OnCuePoint / OnTextData
});
player.on(flvjs.Events.STATISTICS_INFO, function(data) {
console.log("STATISTICS_INFO", data)
});
player.attachMediaElement(element);
player.load();
}
Expand Down Expand Up @@ -221,4 +230,4 @@

</body>

</html>
</html>
3 changes: 3 additions & 0 deletions docs/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ Return a `FeatureList` object which has following details:
| `networkStreamIO` | `boolean` | Indicates whether the network loader is streaming. |
| `networkLoaderName` | `string` | Indicates the network loader type name. |
| `nativeMP4H264Playback` | `boolean` | Indicates whether your browser support H.264 MP4 video file natively. |
| `nativeMP4H265Playback` | `boolean` | Indicates whether your browser support H.265 MP4 video file natively. |
| `nativeWebmVP8Playback` | `boolean` | Indicates whether your browser support WebM VP8 video file natively. |
| `nativeWebmVP9Playback` | `boolean` | Indicates whether your browser support WebM VP9 video file natively. |

Expand Down Expand Up @@ -193,6 +194,8 @@ A series of constants that can be used with `Player.on()` / `Player.off()`. They
| METADATA_ARRIVED | Provides metadata which FLV file(stream) can contain with an "onMetaData" marker. |
| SCRIPTDATA_ARRIVED | Provides scriptdata (OnCuePoint / OnTextData) which FLV file(stream) can contain. |
| STATISTICS_INFO | Provides playback statistics information like dropped frames, current speed, etc. |
| DESTROYING | Fired when the player begins teardown |
| PROGRESS | Fired when the player has progress |

### flvjs.ErrorTypes

Expand Down
Loading