Skip to content

Commit

Permalink
Patch/v1.4.1 doris (#80)
Browse files Browse the repository at this point in the history
* reference v1 jsdelivr url in v1 api doc

people should be using that over latest so that things don't break when we release v2 with potentially breaking changes. Main readme already used v1 url

* chore(deps): update dependency @rollup/plugin-alias to v4.0.4

* chore(deps): update dependency @microsoft/api-documenter to v7.21.7

* chore(deps): update dependency @rollup/plugin-typescript to v11.1.0

* chore(deps): update dependency @rollup/plugin-node-resolve to v15.0.2

* chore(deps): update dependency wrangler to v2.15.0

* chore(deps): update dependency @rollup/plugin-alias to v5

* Fix readme logos & add Mux logo (video-dev#5390)

* docs: replace broken logo with Mux

* docs: fix TED logo

* docs: replace broken logos

* chore(deps): update dependency lint-staged to v13.2.1

* chore(deps): update dependency typescript to v5.0.4

* chore(deps): update dependency eslint to v8.38.0

* chore(deps): update dependency es-check to v7.1.1

* chore(deps): update dependency @rollup/plugin-terser to v0.4.1

* chore(deps): update typescript-eslint monorepo to v5.58.0

* chore(deps): update dependency semver to v7.4.0

* chore(deps): update dependency @rollup/plugin-commonjs to v24.1.0

* chore(deps): update dependency semver to v7.5.0

* chore(deps): update typescript-eslint monorepo to v5.59.0

* Setup npm provenance statements (video-dev#5406)

* give publish job permissions for npm provenance

* add `—provenance` flag to `npm publish`

* remove unneeded `contents` permission

* chore(deps): update dependency chromedriver to v112 (video-dev#5393)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Tom Jenkinson <[email protected]>

* set `internalChecksAsSuccess` renovate option

* chore(deps): update dependency wrangler to v2.15.1

* set renovate `prNotPendingHours` to 0

* chore(deps): update dependency wrangler to v2.16.0

* chore(deps): update dependency rollup to v3.20.3

* chore(deps): update dependency rollup to v3.20.7

* chore(deps): update dependency rollup to v3.21.0

* chore(deps): update tjenkinson/gh-action-auto-merge-dependency-updates digest to 01b22a9 (video-dev#5324)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* tweak renovate options again

see renovatebot/renovate#21720

* reset remainderData in resetContiguity (video-dev#5410)

* docs: add Media Chrome for custom UI (video-dev#5391)

* Perform playlist retries before redundant failover and level switch (video-dev#5420)

(Pathway switch is still prioritized over retries when available)
Fixes video-dev#5419

* chore(deps): update dependency sinon to v15.0.4

* chore(deps): update dependency karma-chrome-launcher to v3.2.0

* chore(deps): update dependency selenium-webdriver to v4.9.0

* Update audio-track-controller.ts (video-dev#5431)

Sometimes STABLE-RENDITION_ID of tracks is undefined. Adding a guard for it, otherwise audio track doesn't switch.

* chore(deps): update dependency eslint to v8.39.0

* chore(deps): update dependency karma to v6.4.2

* chore(deps): update dependency prettier to v2.8.8

* Fix incorrect HEVC main profile codec id (video-dev#5438)

* fix: move `types` condition to the front (video-dev#5439)

* chore(deps): update dependency wrangler to v2.17.0

* chore(deps): update typescript-eslint monorepo to v5.59.1

* chore(deps): update typescript-eslint monorepo to v5.59.2

* Fix Low-Latency part and fragment tracking (video-dev#5423)

* Fix Low-Latency part and fragment tracking regression introduced in video-dev#5102

* Fix issues with reuse of player instance when loading additional assets
Fixes video-dev#5425

* Reset SourceBuffers in `loadSource()` when the asset URL has changed, or buffer-controller setup has begun

* Remove old parts from the fragment tracker on frag buffered

* Remove old parts from the fragment tracker on frag buffered

* Reset eme-controller key format promise on manifest loading

* chore(deps): update dependency lint-staged to v13.2.2

* Always use MediaSource returned by utils module (video-dev#5448)

* chore(deps): update dependency @microsoft/api-documenter to v7.22.0

* chore(deps): update dependency @microsoft/api-documenter to v7.22.4

* chore: Modify version

* chore: remove package-lock.json

---------

Co-authored-by: Tom Jenkinson <[email protected]>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: hlsjs-ci <[email protected]>
Co-authored-by: Wesley Luyten <[email protected]>
Co-authored-by: Billy Chiu <[email protected]>
Co-authored-by: Rob Walch <[email protected]>
Co-authored-by: Agajan J <[email protected]>
Co-authored-by: Sta Zhu <[email protected]>
Co-authored-by: Mateusz Burzyński <[email protected]>
Co-authored-by: yajin2021 <[email protected]>
  • Loading branch information
11 people authored May 6, 2023
1 parent a68d9a5 commit b4219f1
Show file tree
Hide file tree
Showing 26 changed files with 281 additions and 207 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/automerge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
run:
runs-on: ubuntu-latest
steps:
- uses: tjenkinson/gh-action-auto-merge-dependency-updates@b2d85843a11a4075ea396c995a677a5ca1ba5c19
- uses: tjenkinson/gh-action-auto-merge-dependency-updates@01b22a97735b01be6bc1d8a2705f7ee167472414
with:
repo-token: ${{ secrets.CI_GITHUB_TOKEN }}
allowed-actors: renovate[bot]
2 changes: 2 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,8 @@ jobs:
needs: [config, test_unit]
if: needs.config.outputs.tag || needs.config.outputs.isMainBranch == 'true'
runs-on: ubuntu-latest
permissions:
id-token: write
steps:
- uses: actions/checkout@v3

Expand Down
28 changes: 16 additions & 12 deletions README.md

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions api-extractor/report/hls.js.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,8 @@ export class BaseStreamController extends TaskLoop implements NetworkComponentAP
// (undocumented)
protected fragPrevious: Fragment | null;
// (undocumented)
protected getAppendedFrag(position: number, playlistType?: PlaylistLevelType): Fragment | null;
// (undocumented)
protected getCurrentContext(chunkMeta: ChunkMetadata): {
frag: Fragment;
part: Part | null;
Expand Down
10 changes: 5 additions & 5 deletions docs/API.md
Original file line number Diff line number Diff line change
Expand Up @@ -174,16 +174,16 @@ See [API Reference](https://hlsjs-dev.video-dev.org/api-docs/) for a complete li

### First step: setup and support

First include `https://cdn.jsdelivr.net/npm/hls.js@latest` (or `/hls.js` for unminified) in your web page.
First include `https://cdn.jsdelivr.net/npm/hls.js@1` (or `/hls.js` for unminified) in your web page.

```html
<script src="//cdn.jsdelivr.net/npm/hls.js@latest"></script>
<script src="//cdn.jsdelivr.net/npm/hls.js@1"></script>
```

Invoke the following static method: `Hls.isSupported()` to check whether your browser is supporting [MediaSource Extensions](http://w3c.github.io/media-source/).

```html
<script src="https://cdn.jsdelivr.net/npm/hls.js@latest"></script>
<script src="https://cdn.jsdelivr.net/npm/hls.js@1"></script>
<script>
if (Hls.isSupported()) {
console.log('hello hls.js!');
Expand All @@ -200,7 +200,7 @@ Let's
- bind video element to this HLS object

```html
<script src="https://cdn.jsdelivr.net/npm/hls.js@latest"></script>
<script src="https://cdn.jsdelivr.net/npm/hls.js@1"></script>

<video id="video"></video>
<script>
Expand All @@ -222,7 +222,7 @@ Let's
You need to provide manifest URL as below:

```html
<script src="https://cdn.jsdelivr.net/npm/hls.js@latest"></script>
<script src="https://cdn.jsdelivr.net/npm/hls.js@1"></script>

<video id="video"></video>
<script>
Expand Down
48 changes: 24 additions & 24 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "hls.js",
"version": "1.4.1",
"version": "1.4.2",
"license": "Apache-2.0",
"description": "JavaScript HLS client using MediaSourceExtension",
"homepage": "https://github.com/video-dev/hls.js",
Expand All @@ -17,9 +17,9 @@
"types": "./dist/hls.js.d.ts",
"exports": {
".": {
"types": "./dist/hls.js.d.ts",
"import": "./dist/hls.mjs",
"require": "./dist/hls.js",
"types": "./dist/hls.js.d.ts"
"require": "./dist/hls.js"
},
"./dist/*": "./dist/*",
"./package.json": "./package.json"
Expand Down Expand Up @@ -71,29 +71,29 @@
"@babel/preset-env": "7.21.4",
"@babel/preset-typescript": "7.21.4",
"@babel/register": "7.21.0",
"@microsoft/api-documenter": "7.21.6",
"@microsoft/api-documenter": "7.22.4",
"@microsoft/api-extractor": "7.34.4",
"@rollup/plugin-alias": "4.0.3",
"@rollup/plugin-alias": "5.0.0",
"@rollup/plugin-babel": "6.0.3",
"@rollup/plugin-commonjs": "24.0.1",
"@rollup/plugin-node-resolve": "15.0.1",
"@rollup/plugin-commonjs": "24.1.0",
"@rollup/plugin-node-resolve": "15.0.2",
"@rollup/plugin-replace": "5.0.2",
"@rollup/plugin-terser": "0.4.0",
"@rollup/plugin-typescript": "11.0.0",
"@rollup/plugin-terser": "0.4.1",
"@rollup/plugin-typescript": "11.1.0",
"@types/chai": "4.3.4",
"@types/chart.js": "2.9.37",
"@types/mocha": "10.0.1",
"@types/sinon-chai": "3.2.9",
"@typescript-eslint/eslint-plugin": "5.57.1",
"@typescript-eslint/parser": "5.57.1",
"@typescript-eslint/eslint-plugin": "5.59.2",
"@typescript-eslint/parser": "5.59.2",
"babel-loader": "9.1.2",
"babel-plugin-transform-remove-console": "6.9.4",
"chai": "4.3.7",
"chart.js": "2.9.4",
"chromedriver": "111.0.0",
"chromedriver": "112.0.0",
"doctoc": "2.2.1",
"es-check": "7.1.0",
"eslint": "8.37.0",
"es-check": "7.1.1",
"eslint": "8.39.0",
"eslint-config-prettier": "8.8.0",
"eslint-plugin-import": "2.27.5",
"eslint-plugin-mocha": "10.1.0",
Expand All @@ -103,31 +103,31 @@
"http-server": "14.1.1",
"husky": "8.0.3",
"jsonpack": "1.1.5",
"karma": "6.4.1",
"karma-chrome-launcher": "3.1.1",
"karma": "6.4.2",
"karma-chrome-launcher": "3.2.0",
"karma-coverage": "2.2.0",
"karma-mocha": "2.0.1",
"karma-mocha-reporter": "2.2.5",
"karma-rollup-preprocessor": "7.0.8",
"karma-sinon-chai": "2.0.2",
"karma-sourcemap-loader": "0.4.0",
"lint-staged": "13.2.0",
"lint-staged": "13.2.2",
"markdown-styles": "3.2.0",
"micromatch": "4.0.5",
"mocha": "10.2.0",
"node-fetch": "3.3.1",
"npm-run-all": "4.1.5",
"prettier": "2.8.7",
"prettier": "2.8.8",
"promise-polyfill": "8.3.0",
"rollup": "3.20.2",
"rollup": "3.21.0",
"rollup-plugin-istanbul": "4.0.0",
"sauce-connect-launcher": "1.3.2",
"selenium-webdriver": "4.8.2",
"semver": "7.3.8",
"sinon": "15.0.3",
"selenium-webdriver": "4.9.0",
"semver": "7.5.0",
"sinon": "15.0.4",
"sinon-chai": "3.7.0",
"typescript": "5.0.3",
"typescript": "5.0.4",
"url-toolkit": "2.2.5",
"wrangler": "2.14.0"
"wrangler": "2.17.0"
}
}
5 changes: 3 additions & 2 deletions renovate.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
"labels": ["dependencies", "skip-change-log"],
"prHourlyLimit": 0,
"prConcurrentLimit": 0,
"prCreation": "not-pending",
"stabilityDays": 7,
"prCreation": "immediate",
"minimumReleaseAge": "7 days",
"internalChecksFilter": "strict",
"vulnerabilityAlerts": {
"addLabels": ["security"]
},
Expand Down
4 changes: 2 additions & 2 deletions scripts/publish-npm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ if [[ $(node ./scripts/check-already-published.js) = "not published" ]]; then
# see https://docs.npmjs.com/private-modules/ci-server-config
echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" >> .npmrc
if [[ -z "$TAG" ]]; then
npm publish --tag canary
npm publish --provenance --tag canary
echo "Published canary."
curl https://purge.jsdelivr.net/npm/hls.js@canary
curl https://purge.jsdelivr.net/npm/hls.js@canary/dist/hls-demo.js
Expand All @@ -19,7 +19,7 @@ if [[ $(node ./scripts/check-already-published.js) = "not published" ]]; then
exit 1
fi
echo "Publishing tag: ${tag}"
npm publish --tag "${tag}"
npm publish --provenance --tag "${tag}"
curl "https://purge.jsdelivr.net/npm/hls.js@${tag}"
echo "Published."
fi
Expand Down
28 changes: 18 additions & 10 deletions src/controller/audio-stream-controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -391,10 +391,7 @@ class AudioStreamController
(!mainBufferInfo?.len && bufferInfo.len)
) {
// Check fragment-tracker for main fragments since GAP segments do not show up in bufferInfo
const mainFrag = this.fragmentTracker.getBufferedFrag(
frag.start,
PlaylistLevelType.MAIN
);
const mainFrag = this.getAppendedFrag(frag.start, PlaylistLevelType.MAIN);
if (mainFrag === null) {
return;
}
Expand Down Expand Up @@ -472,12 +469,18 @@ class AudioStreamController
}

onManifestLoading() {
this.mainDetails = null;
this.fragmentTracker.removeAllFragments();
this.startPosition = this.lastCurrentTime = 0;
this.bufferFlushed = false;
this.bufferedTrack = null;
this.switchingTrack = null;
this.levels =
this.mainDetails =
this.waitingData =
this.bufferedTrack =
this.cachedTrackLoadedData =
this.switchingTrack =
null;
this.startFragRequested = false;
this.trackId = this.videoTrackCC = this.waitingVideoCC = -1;
}

onLevelLoaded(event: Events.LEVEL_LOADED, data: LevelLoadedData) {
Expand All @@ -500,7 +503,11 @@ class AudioStreamController
return;
}
this.log(
`Track ${trackId} loaded [${newDetails.startSN},${newDetails.endSN}],duration:${newDetails.totalduration}`
`Track ${trackId} loaded [${newDetails.startSN},${newDetails.endSN}]${
newDetails.lastPartSn
? `[part-${newDetails.lastPartSn}-${newDetails.lastPartIndex}]`
: ''
},duration:${newDetails.totalduration}`
);

const track = levels[trackId];
Expand Down Expand Up @@ -768,9 +775,10 @@ class AudioStreamController
}

if (initSegment?.tracks) {
this._bufferInitSegment(initSegment.tracks, frag, chunkMeta);
const mapFragment = frag.initSegment || frag;
this._bufferInitSegment(initSegment.tracks, mapFragment, chunkMeta);
hls.trigger(Events.FRAG_PARSING_INIT_SEGMENT, {
frag,
frag: mapFragment,
id,
tracks: initSegment.tracks,
});
Expand Down
5 changes: 3 additions & 2 deletions src/controller/audio-track-controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -236,8 +236,9 @@ class AudioTrackController extends BasePlaylistController {
if (!this.selectDefaultTrack || track.default) {
if (
!currentTrack ||
currentTrack.attrs['STABLE-RENDITION-ID'] ===
track.attrs['STABLE-RENDITION-ID']
(currentTrack.attrs['STABLE-RENDITION-ID'] !== undefined &&
currentTrack.attrs['STABLE-RENDITION-ID'] ===
track.attrs['STABLE-RENDITION-ID'])
) {
return track.id;
}
Expand Down
6 changes: 4 additions & 2 deletions src/controller/base-playlist-controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -309,9 +309,11 @@ export default class BasePlaylistController implements NetworkComponentAPI {
const errorAction = errorEvent.errorAction;
const { action, retryCount = 0, retryConfig } = errorAction || {};
const retry =
action === NetworkErrorAction.RetryRequest &&
!!errorAction &&
!!retryConfig;
!!retryConfig &&
(action === NetworkErrorAction.RetryRequest ||
(!errorAction.resolved &&
action === NetworkErrorAction.SendAlternateToPenaltyBox));
if (retry) {
this.requestScheduled = -1;
if (isTimeout && errorEvent.context?.deliveryDirectives) {
Expand Down
Loading

0 comments on commit b4219f1

Please sign in to comment.