Skip to content

Commit 38cb8c8

Browse files
authored
Merge branch 'development' into task/segement-template-util
2 parents 69a98c7 + 4dc0e25 commit 38cb8c8

25 files changed

+618
-117
lines changed

.github/workflows/deploy.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ jobs:
5050
done
5151
- name: Copy to deploy directory for deployment
5252
run: |
53-
mkdir ${{inputs.envname}}
53+
mkdir -p ${{inputs.envname}}
5454
cp -R contrib dist samples ${{inputs.envname}}
5555
- name: Install SSH Key
5656
uses: shimataro/ssh-key-action@v2
@@ -59,4 +59,5 @@ jobs:
5959
known_hosts: unnecessary
6060
- name: Deploy with scp
6161
run: |
62-
scp -r -o StrictHostKeyChecking=no -oHostKeyAlgorithms=+ssh-dss ${{inputs.envname}} ${{ secrets.user }}@${{ secrets.host }}:${{ inputs.deploy_path }}
62+
ssh -o StrictHostKeyChecking=no -oHostKeyAlgorithms=+ssh-dss ${{ secrets.USER }}@${{ secrets.HOST }} "mkdir -p ${{ inputs.deploy_path }}/${{inputs.envname}}"
63+
scp -r -o StrictHostKeyChecking=no -oHostKeyAlgorithms=+ssh-dss ${{inputs.envname}} ${{ secrets.user }}@${{ secrets.host }}:${{ inputs.deploy_path }}

.github/workflows/deploy_build.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: deploy_build
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
envname:
7+
required: true
8+
type: string
9+
deploy_path:
10+
required: true
11+
type: string
12+
secrets:
13+
host:
14+
required: true
15+
user:
16+
required: true
17+
private_key:
18+
required: true
19+
20+
jobs:
21+
deploy:
22+
runs-on: ubuntu-latest
23+
24+
steps:
25+
- uses: actions/checkout@v4
26+
- name: Use Node.js
27+
uses: actions/setup-node@v4
28+
with:
29+
node-version: "20.x"
30+
- name: Install dependencies
31+
run: npm install
32+
- name: Build dist files
33+
run: npm run build
34+
- name: Build JSDoc
35+
run: npm run doc
36+
continue-on-error: true
37+
- name: Copy to deploy directory for deployment
38+
run: |
39+
mkdir -p ${{inputs.envname}}
40+
cp -R docs/jsdoc ${{inputs.envname}}/jsdoc && cp -R dist/modern/umd/* ${{inputs.envname}} && cp -R dist/* index.d.ts ${{inputs.envname}}
41+
- name: Install SSH Key
42+
uses: shimataro/ssh-key-action@v2
43+
with:
44+
key: ${{ secrets.private_key }}
45+
known_hosts: unnecessary
46+
- name: Deploy with scp
47+
run: |
48+
ssh -o StrictHostKeyChecking=no -oHostKeyAlgorithms=+ssh-dss ${{ secrets.USER }}@${{ secrets.HOST }} "mkdir -p ${{ inputs.deploy_path }}/${{inputs.envname}}"
49+
scp -r -o StrictHostKeyChecking=no -oHostKeyAlgorithms=+ssh-dss ${{inputs.envname}} ${{ secrets.user }}@${{ secrets.host }}:${{ inputs.deploy_path }}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: deploy_latest
2+
3+
on:
4+
push:
5+
branches:
6+
- 'master'
7+
8+
jobs:
9+
deploy_latest:
10+
if: github.repository == 'Dash-Industry-Forum/dash.js'
11+
uses: ./.github/workflows/deploy_build.yml
12+
with:
13+
envname: latest
14+
deploy_path: '/377335'
15+
secrets:
16+
host: ${{secrets.HOST}}
17+
user: ${{secrets.USER}}
18+
private_key: ${{secrets.PRIVATE_KEY}}
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: deploy_build_latest_as_version_folder
2+
3+
on:
4+
push:
5+
branches:
6+
- 'master'
7+
8+
jobs:
9+
get_version_number:
10+
if: github.repository == 'Dash-Industry-Forum/dash.js'
11+
runs-on: ubuntu-latest
12+
outputs:
13+
version: ${{ steps.set_version.outputs.version }}
14+
steps:
15+
- name: Check out repository
16+
uses: actions/checkout@v4
17+
18+
- name: Read version from package.json
19+
id: set_version
20+
run: |
21+
echo "version=$(jq -r .version package.json)" >> $GITHUB_OUTPUT
22+
shell: bash
23+
24+
- name: Print version
25+
run: |
26+
echo "Version: ${{ steps.set_version.outputs.version }}"
27+
28+
deploy:
29+
if: github.repository == 'Dash-Industry-Forum/dash.js'
30+
needs: get_version_number
31+
uses: ./.github/workflows/deploy_build.yml
32+
with:
33+
envname: v${{ needs.get_version_number.outputs.version }}
34+
deploy_path: '/377335'
35+
secrets:
36+
host: ${{ secrets.HOST }}
37+
user: ${{ secrets.USER }}
38+
private_key: ${{ secrets.PRIVATE_KEY }}

.github/workflows/deploy_latest.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66
- 'master'
77

88
jobs:
9-
deploy_staging:
9+
deploy_latest:
1010
if: github.repository == 'Dash-Industry-Forum/dash.js'
1111
uses: ./.github/workflows/deploy.yml
1212
with:
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: deploy_latest_as_version_folder
2+
3+
on:
4+
push:
5+
branches:
6+
- 'master'
7+
8+
jobs:
9+
get_version_number:
10+
if: github.repository == 'Dash-Industry-Forum/dash.js'
11+
runs-on: ubuntu-latest
12+
outputs:
13+
version: ${{ steps.set_version.outputs.version }}
14+
steps:
15+
- name: Check out repository
16+
uses: actions/checkout@v4
17+
18+
- name: Read version from package.json
19+
id: set_version
20+
run: |
21+
echo "version=$(jq -r .version package.json)" >> $GITHUB_OUTPUT
22+
shell: bash
23+
24+
- name: Print version
25+
run: |
26+
echo "Version: ${{ steps.set_version.outputs.version }}"
27+
28+
deploy:
29+
if: github.repository == 'Dash-Industry-Forum/dash.js'
30+
needs: get_version_number
31+
uses: ./.github/workflows/deploy.yml
32+
with:
33+
envname: v${{ needs.get_version_number.outputs.version }}
34+
deploy_path: '/377335/dash.js'
35+
secrets:
36+
host: ${{ secrets.HOST }}
37+
user: ${{ secrets.USER }}
38+
private_key: ${{ secrets.PRIVATE_KEY }}

index.d.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1768,8 +1768,9 @@ declare namespace dashjs {
17681768
trackSwitchMode?: {
17691769
video?: TrackSwitchMode;
17701770
audio?: TrackSwitchMode;
1771-
}
1772-
selectionModeForInitialTrack?: TrackSelectionMode
1771+
};
1772+
ignoreSelectionPriority?: boolean;
1773+
selectionModeForInitialTrack?: TrackSelectionMode;
17731774
fragmentRequestTimeout?: number;
17741775
fragmentRequestProgressTimeout?: number;
17751776
manifestRequestTimeout?: number;
@@ -2845,7 +2846,6 @@ declare namespace dashjs {
28452846
TRACK_SELECTION_MODE_HIGHEST_BITRATE: 'highestBitrate',
28462847
TRACK_SELECTION_MODE_HIGHEST_EFFICIENCY: 'highestEfficiency',
28472848
TRACK_SELECTION_MODE_WIDEST_RANGE: 'widestRange',
2848-
TRACK_SELECTION_MODE_HIGHEST_SELECTION_PRIORITY: 'highestSelectionPriority',
28492849
CMCD_MODE_QUERY: 'query',
28502850
CMCD_MODE_HEADER: 'header',
28512851
CMCD_AVAILABLE_KEYS: ['br', 'd', 'ot', 'tb', 'bl', 'dl', 'mtp', 'nor', 'nrr', 'su', 'bs', 'rtp', 'cid', 'pr', 'sf', 'sid', 'st', 'v'],

src/core/Settings.js

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,8 @@ import Events from './events/Events.js';
188188
* audio: Constants.TRACK_SWITCH_MODE_ALWAYS_REPLACE,
189189
* video: Constants.TRACK_SWITCH_MODE_NEVER_REPLACE
190190
* },
191-
* selectionModeForInitialTrack: Constants.TRACK_SELECTION_MODE_HIGHEST_SELECTION_PRIORITY,
191+
* ignoreSelectionPriority: false,
192+
* selectionModeForInitialTrack: Constants.TRACK_SELECTION_MODE_HIGHEST_EFFICIENCY,
192193
* fragmentRequestTimeout: 20000,
193194
* fragmentRequestProgressTimeout: -1,
194195
* manifestRequestTimeout: 10000,
@@ -998,14 +999,14 @@ import Events from './events/Events.js';
998999
* - Constants.TRACK_SWITCH_MODE_NEVER_REPLACE
9991000
* Do not replace existing segments in the buffer
10001001
*
1001-
* @property {string} [selectionModeForInitialTrack="highestSelectionPriority"]
1002+
* @property {} [ignoreSelectionPriority: false]
1003+
* provides the option to disregard any signalled selectionPriority attribute. If disabled and if no initial media settings are set, track selection is accomplished as defined by selectionModeForInitialTrack.
1004+
*
1005+
* @property {string} [selectionModeForInitialTrack="highestEfficiency"]
10021006
* Sets the selection mode for the initial track. This mode defines how the initial track will be selected if no initial media settings are set. If initial media settings are set this parameter will be ignored. Available options are:
10031007
*
10041008
* Possible values
10051009
*
1006-
* - Constants.TRACK_SELECTION_MODE_HIGHEST_SELECTION_PRIORITY
1007-
* This mode makes the player select the track with the highest selectionPriority as defined in the manifest. If not selectionPriority is given we fallback to TRACK_SELECTION_MODE_HIGHEST_BITRATE. This mode is a default mode.
1008-
*
10091010
* - Constants.TRACK_SELECTION_MODE_HIGHEST_BITRATE
10101011
* This mode makes the player select the track with a highest bitrate.
10111012
*
@@ -1230,7 +1231,8 @@ function Settings() {
12301231
audio: Constants.TRACK_SWITCH_MODE_ALWAYS_REPLACE,
12311232
video: Constants.TRACK_SWITCH_MODE_NEVER_REPLACE
12321233
},
1233-
selectionModeForInitialTrack: Constants.TRACK_SELECTION_MODE_HIGHEST_SELECTION_PRIORITY,
1234+
ignoreSelectionPriority: false,
1235+
selectionModeForInitialTrack: Constants.TRACK_SELECTION_MODE_HIGHEST_EFFICIENCY,
12341236
fragmentRequestTimeout: 20000,
12351237
fragmentRequestProgressTimeout: -1,
12361238
manifestRequestTimeout: 10000,

src/core/Utils.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,11 @@ class Utils {
250250
return Utils.toDataView(bufferSource, Uint8Array)
251251
}
252252

253+
static uint8ArrayToString(uint8Array) {
254+
const decoder = new TextDecoder('utf-8');
255+
return decoder.decode(uint8Array);
256+
}
257+
253258
static bufferSourceToHex(data) {
254259
const arr = Utils.bufferSourceToInt8(data)
255260
let hex = '';

src/dash/controllers/ContentSteeringController.js

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,6 @@ function ContentSteeringController() {
282282

283283
const additionalQueryParameter = [];
284284

285-
286285
const serviceLocations = serviceLocationList.baseUrl.all.concat(serviceLocationList.location.all);
287286
if (serviceLocations.length > 0) {
288287

@@ -295,26 +294,18 @@ function ContentSteeringController() {
295294
}
296295
})
297296

298-
// Sort in descending order to put all elements without throughput (-1) in the end
299-
data.sort((a, b) => {
300-
return b.throughput - a.throughput
301-
})
302-
303297
let pathwayString = '';
304298
let throughputString = '';
305299

306300
data.forEach((entry, index) => {
307301
if (index !== 0) {
308-
pathwayString = `${pathwayString},`;
309-
if (entry.throughput > -1) {
310-
throughputString = `${throughputString},`;
311-
}
302+
pathwayString += ',';
303+
throughputString += ',';
312304
}
313-
pathwayString = `${pathwayString}${entry.serviceLocation}`;
314-
if (entry.throughput > -1) {
315-
throughputString = `${throughputString}${entry.throughput}`;
316-
}
317-
})
305+
306+
pathwayString += entry.serviceLocation;
307+
throughputString += entry.throughput > -1 ? entry.throughput : '';
308+
});
318309

319310
additionalQueryParameter.push({
320311
key: QUERY_PARAMETER_KEYS.PATHWAY,

0 commit comments

Comments
 (0)