You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Exposes hls.js's `capRenditionToPlayerSize` option with a Mux-optimized
default.
Closes#1238 (based off of initial effort from @spuppo-mux in #1251)
### Behavior
| Value | Behavior |
|-------|----------|
| `undefined` (default) | Caps to player size, 720p minimum floor |
| `true` | Standard hls.js capping (may go below 720p) |
| `false` | No capping |
### Test plan
- [ ] `npm run dev` → http://localhost:3000/MuxPlayer
- [ ] Toggle "Cap Level To Player Size" between None/true/false
- [ ] Verify no console errors
- [ ] Verify config:
`document.querySelector('mux-player').media.nativeEl._hls.config.capLevelToPlayerSize`
- [ ] Trigger a rendition switch/re-selection via ABR - e.g. open Chrome
Dev Tools, resize player size, seek backwards during playback to prompt
segment reloading, and confirm that rendition does(n't) get capped under
different permutations
---------
Co-authored-by: Santiago Puppo <spuppo@mux.com>
Copy file name to clipboardExpand all lines: packages/mux-player-react/REFERENCE.md
+4-3Lines changed: 4 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -43,10 +43,11 @@
43
43
|`targetLiveWindow`|`number`| An offset representing the seekable range for live content, where `Infinity` means the entire live content is seekable (aka "standard DVR"). Used along with `streamType` to determine what UI/controls to show. | (inferred from `playbackId` and/or `streamType`, otherwise `NaN`) |
44
44
|`startTime`|`number` (seconds) | Specify where in the media's timeline you want playback to start. |`0`|
45
45
|`preferPlayback`|`"mse" \| "native"`| Specify if Mux Player should try to use Media Source Extension or native playback (if available). If no value is provided, Mux Player will choose based on what's deemed optimal for content and playback environment. | Varies |
46
-
|`maxResolution`|`"720p" \| "1080p" \| "1440p" \| "2160p"`|Specify the maximum resolution you want delivered for this video. | N/A |
47
-
|`minResolution`|`"480p" \| "540p" \| "720p" \| "1080p" \| "1440p" \| "2160p"`|Specify the minimum resolution you want delivered for this video. | N/A |
48
-
|`maxAutoResolution`|`string` (`"720p"`, `"1080p"`, `"1440p"`, or `"2160p"`) |Cap the default resolution selection based on total pixels (width × height) to match Mux Video pricing tiers. Values align with [Mux Video resolution-based pricing](https://www.mux.com/docs/pricing/video#resolution-based-pricing). If there's an exact match, it will be used. Otherwise, selects the highest quality rendition that doesn't exceed the cap. Only accepts: `"720p"`, `"1080p"`, `"1440p"`, or `"2160p"`. Other values are ignored. | N/A |
46
+
|`maxResolution`|`"720p" \| "1080p" \| "1440p" \| "2160p"`|Limits the highest resolution rendition requested from the server. Renditions above this are excluded from the playlist entirely. For client-side dimension-based capping, see `capRenditionToPlayerSize`.| N/A |
47
+
|`minResolution`|`"480p" \| "540p" \| "720p" \| "1080p" \| "1440p" \| "2160p"`|Limits the lowest resolution rendition requested from the server. Renditions below this are excluded from the playlist entirely.| N/A |
48
+
|`maxAutoResolution`|`string` (`"720p"`, `"1080p"`, `"1440p"`, or `"2160p"`) |Caps automatic resolution selection to align with [Mux Video pricing tiers](https://www.mux.com/docs/pricing/video#resolution-based-pricing). The player won't automatically select resolutions above this cap. Unlike `maxResolution`, all renditions remain available. Unlike `capRenditionToPlayerSize`, this is independent of player dimensions.| N/A |
49
49
|`renditionOrder`|`"desc"`| Change the order in which renditions are provided in the src playlist. Can impact initial segment loads. Currently only support `"desc"` for descending order | N/A |
50
+
|`capRenditionToPlayerSize`|`boolean`| Caps video resolution based on the player's display dimensions to avoid downloading video larger than can be displayed. When `undefined` (default), caps to player size with a 720p minimum floor. Set to `true` to cap strictly to player dimensions (may use lower resolutions for small players). Set to `false` to disable dimension-based capping. Independent of `maxResolution` (server-side) and `maxAutoResolution` (pricing cap). |`undefined` (Mux optimized) |
50
51
|`programStartTime`|`number`| Apply PDT-based [instant clips](https://docs.mux.com/guides/create-instant-clips) to the beginning of the media stream. | N/A |
51
52
|`programEndTime`|`number`| Apply PDT-based [instant clips](https://docs.mux.com/guides/create-instant-clips) to the end of the media stream. | N/A |
52
53
|`assetStartTime`|`number`| Apply media timeline-based [instant clips](https://docs.mux.com/guides/create-instant-clips) to the beginning of the media stream. | N/A |
0 commit comments