SRGSSR / pillarbox-web

Pillarbox is a versatile media playback ecosystem engineered for the web.
http://web.pillarbox.ch/api
MIT License
15 stars 1 forks source link

feat(player): simplifies audio track handling #40

Closed amtins closed 1 year ago

amtins commented 1 year ago

Description

Resolves #38 by adding the audioTrack function to simplify audio track retrieval and selection. This function allows to:

Also, when selecting an audio track, if the kind property is not satisfied, the first audio track satisfying the language condition will be returned, or undefined if no condition is satisfied.

// Get the current audio track
player.audioTrack();

// Activate an audio track
player.audioTrack({language:'en', kind:'alternative'})

Changes made

github-actions[bot] commented 1 year ago

Coverage report

St.:grey_question:
Category Percentage Covered / Total
🟒 Statements
98.45% (+0.04% πŸ”Ό)
445/452
🟒 Branches
93.21% (+0.19% πŸ”Ό)
206/221
🟒 Functions 100% 130/130
🟒 Lines
99.31% (+0.01% πŸ”Ό)
433/436
Show new covered files 🐣
|
St.:grey_question:
| File | Statements | Branches | Functions | Lines | | :----------------------------------------------------------------------------------------------------------------------------------------------------: | :-------------------------------------------------------- | :--------- | :------- | :-------- | :---- | | 🟒 |
`...` / player.js
| 100% | 100% | 100% | 100% |

Test suite run success

131 tests passing in 9 suites.

Report generated by πŸ§ͺjest coverage report action from b01c8556fecd7294d474d248bb52b8fc52df2bc3

amtins commented 1 year ago

@defagos thanks for the review πŸ‘πŸ½

github-actions[bot] commented 9 months ago

:tada: This PR is included in version 1.0.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket: