CARVIEW |
Select Language
HTTP/2 200
date: Sat, 26 Jul 2025 01:53:32 GMT
content-type: text/html; charset=utf-8
vary: X-PJAX, X-PJAX-Container, Turbo-Visit, Turbo-Frame, X-Requested-With,Accept-Encoding, Accept, X-Requested-With
x-repository-download: git clone https://github.com/videojs/http-streaming.git
etag: W/"407453b3e14d5167309f7b9fffaf9265"
cache-control: max-age=0, private, must-revalidate
strict-transport-security: max-age=31536000; includeSubdomains; preload
x-frame-options: deny
x-content-type-options: nosniff
x-xss-protection: 0
referrer-policy: no-referrer-when-downgrade
content-security-policy: default-src 'none'; base-uri 'self'; child-src github.githubassets.com github.com/assets-cdn/worker/ github.com/assets/ gist.github.com/assets-cdn/worker/; connect-src 'self' uploads.github.com www.githubstatus.com collector.github.com raw.githubusercontent.com api.github.com github-cloud.s3.amazonaws.com github-production-repository-file-5c1aeb.s3.amazonaws.com github-production-upload-manifest-file-7fdce7.s3.amazonaws.com github-production-user-asset-6210df.s3.amazonaws.com *.rel.tunnels.api.visualstudio.com wss://*.rel.tunnels.api.visualstudio.com objects-origin.githubusercontent.com copilot-proxy.githubusercontent.com proxy.individual.githubcopilot.com proxy.business.githubcopilot.com proxy.enterprise.githubcopilot.com *.actions.githubusercontent.com wss://*.actions.githubusercontent.com productionresultssa0.blob.core.windows.net/ productionresultssa1.blob.core.windows.net/ productionresultssa2.blob.core.windows.net/ productionresultssa3.blob.core.windows.net/ productionresultssa4.blob.core.windows.net/ productionresultssa5.blob.core.windows.net/ productionresultssa6.blob.core.windows.net/ productionresultssa7.blob.core.windows.net/ productionresultssa8.blob.core.windows.net/ productionresultssa9.blob.core.windows.net/ productionresultssa10.blob.core.windows.net/ productionresultssa11.blob.core.windows.net/ productionresultssa12.blob.core.windows.net/ productionresultssa13.blob.core.windows.net/ productionresultssa14.blob.core.windows.net/ productionresultssa15.blob.core.windows.net/ productionresultssa16.blob.core.windows.net/ productionresultssa17.blob.core.windows.net/ productionresultssa18.blob.core.windows.net/ productionresultssa19.blob.core.windows.net/ github-production-repository-image-32fea6.s3.amazonaws.com github-production-release-asset-2e65be.s3.amazonaws.com insights.github.com wss://alive.github.com api.githubcopilot.com api.individual.githubcopilot.com api.business.githubcopilot.com api.enterprise.githubcopilot.com; font-src github.githubassets.com; form-action 'self' github.com gist.github.com copilot-workspace.githubnext.com objects-origin.githubusercontent.com; frame-ancestors 'none'; frame-src viewscreen.githubusercontent.com notebooks.githubusercontent.com; img-src 'self' data: blob: github.githubassets.com media.githubusercontent.com camo.githubusercontent.com identicons.github.com avatars.githubusercontent.com private-avatars.githubusercontent.com github-cloud.s3.amazonaws.com objects.githubusercontent.com release-assets.githubusercontent.com secured-user-images.githubusercontent.com/ user-images.githubusercontent.com/ private-user-images.githubusercontent.com opengraph.githubassets.com copilotprodattachments.blob.core.windows.net/github-production-copilot-attachments/ github-production-user-asset-6210df.s3.amazonaws.com customer-stories-feed.github.com spotlights-feed.github.com objects-origin.githubusercontent.com *.githubusercontent.com; manifest-src 'self'; media-src github.com user-images.githubusercontent.com/ secured-user-images.githubusercontent.com/ private-user-images.githubusercontent.com github-production-user-asset-6210df.s3.amazonaws.com gist.github.com; script-src github.githubassets.com; style-src 'unsafe-inline' github.githubassets.com; upgrade-insecure-requests; worker-src github.githubassets.com github.com/assets-cdn/worker/ github.com/assets/ gist.github.com/assets-cdn/worker/
server: github.com
content-encoding: gzip
accept-ranges: bytes
set-cookie: _gh_sess=ogsLBeWY9dyakTTlCnekKA2hpChDC%2Bgm8qTi7nDo%2BwVjQ3lUwcZJYXfVBtnsqNAT%2Bs5k4rFVHWSz3zNiQJ1TxuAGU8R%2FtbYkHAcgo%2FaHklgRd32U4DVS1UihRpw%2FgCGPP2H5AyLGbWrDgrFvAbFVX0IIiETUpv9zWtxW7ZUpB1DPLbJWdj8v2C3HfXyzhtpJKWeF%2Ft0jLSGt6zXBiHZ38Ju5I3IluvtqnlgVpg8QfJIMNZQr2ZO4DUcMnXCAWrtSviNDDrxyR91PkozRBnEwoA%3D%3D--iS%2B1NZIq863m0QPa--0mD3TdSl00zEx994ZJle8g%3D%3D; Path=/; HttpOnly; Secure; SameSite=Lax
set-cookie: _octo=GH1.1.15309435.1753494812; Path=/; Domain=github.com; Expires=Sun, 26 Jul 2026 01:53:32 GMT; Secure; SameSite=Lax
set-cookie: logged_in=no; Path=/; Domain=github.com; Expires=Sun, 26 Jul 2026 01:53:32 GMT; HttpOnly; Secure; SameSite=Lax
x-github-request-id: B73C:138BF2:A5757:10552D:6884351C
feat: Consider object-fit when selecting playlist by player size (#1… · videojs/http-streaming@2c52076 · GitHub
Copy file name to clipboardExpand all lines: src/videojs-http-streaming.js
Skip to content
Navigation Menu
{{ message }}
-
Notifications
You must be signed in to change notification settings - Fork 433
Commit 2c52076
feat: Consider object-fit when selecting playlist by player size (#1051)
* Make simple playlist selecor easier to extend
Refactor from positional parameters to a single `settings`
argument. This makes it clearer what each argument means in calls of
the function. Additional parameters can now be added without making
the argument list overly long.
Key names were chosen to match those of
`minRebufferMaxBandwidthSelector` to align the signatures.
* Make simpleSelector test easier to understand
Inline the passed bandwidth value instead of referencing the config
constant since the concrete value is needed to understand why the
expected playlist is chosen. Also if the config constant should ever
change the test will fail for no good reason.
* Consider object-fit when selecting playlist by player size
So far, when `limitRenditionByPlayerDimensions` is `true`,
`simpleSelector` tried to either find a rendition with a resolution
that matches the size of the player exactly or, if that does not
exist, a rendition with the smallest resolution that has either
greater width or greater height than the player. This makes sense
since by default the video will be scaled to fit inside the media
element. So every resolution that exceeds player size in at least one
dimension will be scaled down.
Most browsers support [1] customizing this scaling behavior via the
`object-fit` CSS property [2]. If it set to `cover`, the video will
instead be scaled up if video and player aspect ratio do not match.
The previous behavior caused renditions with low resolution to be
selected for players with small width (e.g. portrait phone aspect
ratio) even when videos were then scaled up to cover the whole player.
We therefore detect if `object-fit` is set to `cover` and instead
select the smallest rendition with a resolution that exceeds player
dimensions in both width and height.
[1] https://caniuse.com/?search=object-fit
[2] https://developer.mozilla.org/de/docs/Web/CSS/object-fit
* Add usePlayerObjectFit option
Only consider `object-fit` CSS property when selecting playlists based
on play size when `usePlayerObjectFit` option is `true` to make new
behavior an opt-in.
* chore: add object-fit option to the demo page
---------
Co-authored-by: Dzianis Dashkevich <98566601+dzianis-dashkevich@users.noreply.github.com>1 parent c1d3186 commit 2c52076Copy full SHA for 2c52076
File tree
Expand file treeCollapse file tree
7 files changed
+196
-45
lines changedFilter options
- scripts
- src
- test
Expand file treeCollapse file tree
7 files changed
+196
-45
lines changed+13Lines changed: 13 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
49 | 49 |
| |
50 | 50 |
| |
51 | 51 |
| |
| 52 | + | |
52 | 53 |
| |
53 | 54 |
| |
54 | 55 |
| |
| |||
414 | 415 |
| |
415 | 416 |
| |
416 | 417 |
| |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
417 | 429 |
| |
418 | 430 |
| |
419 | 431 |
| |
| |||
426 | 438 |
| |
427 | 439 |
| |
428 | 440 |
| |
| 441 | + | |
429 | 442 |
| |
430 | 443 |
| |
431 | 444 |
| |
|
+5Lines changed: 5 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
172 | 172 |
| |
173 | 173 |
| |
174 | 174 |
| |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
175 | 180 |
| |
176 | 181 |
| |
177 | 182 |
| |
|
+4-1Lines changed: 4 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
471 | 471 |
| |
472 | 472 |
| |
473 | 473 |
| |
| 474 | + | |
474 | 475 |
| |
475 | 476 |
| |
476 | 477 |
| |
| |||
523 | 524 |
| |
524 | 525 |
| |
525 | 526 |
| |
| 527 | + | |
526 | 528 |
| |
527 | 529 |
| |
528 | 530 |
| |
| |||
615 | 617 |
| |
616 | 618 |
| |
617 | 619 |
| |
618 |
| - | |
| 620 | + | |
| 621 | + | |
619 | 622 |
| |
620 | 623 |
| |
621 | 624 |
| |
|
+52-31Lines changed: 52 additions & 31 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
133 | 133 |
| |
134 | 134 |
| |
135 | 135 |
| |
136 |
| - | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
137 | 139 |
| |
138 |
| - | |
| 140 | + | |
139 | 141 |
| |
140 |
| - | |
| 142 | + | |
141 | 143 |
| |
142 |
| - | |
| 144 | + | |
143 | 145 |
| |
144 |
| - | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
145 | 151 |
| |
146 |
| - | |
| 152 | + | |
147 | 153 |
| |
148 | 154 |
| |
149 | 155 |
| |
150 | 156 |
| |
151 | 157 |
| |
152 |
| - | |
153 |
| - | |
154 |
| - | |
155 |
| - | |
156 |
| - | |
157 |
| - | |
158 |
| - | |
159 |
| - | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
160 | 168 |
| |
161 | 169 |
| |
162 | 170 |
| |
| |||
271 | 279 |
| |
272 | 280 |
| |
273 | 281 |
| |
274 |
| - | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
275 | 294 |
| |
276 | 295 |
| |
277 | 296 |
| |
| |||
370 | 389 |
| |
371 | 390 |
| |
372 | 391 |
| |
373 |
| - | |
374 |
| - | |
375 |
| - | |
376 |
| - | |
377 |
| - | |
378 |
| - | |
379 |
| - | |
380 |
| - | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
381 | 401 |
| |
382 | 402 |
| |
383 | 403 |
| |
| |||
425 | 445 |
| |
426 | 446 |
| |
427 | 447 |
| |
428 |
| - | |
429 |
| - | |
430 |
| - | |
431 |
| - | |
432 |
| - | |
433 |
| - | |
434 |
| - | |
435 |
| - | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
436 | 457 |
| |
437 | 458 |
| |
438 | 459 |
| |
|
src/videojs-http-streaming.js
Copy file name to clipboardExpand all lines: src/videojs-http-streaming.js+3Lines changed: 3 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
691 | 691 |
| |
692 | 692 |
| |
693 | 693 |
| |
| 694 | + | |
694 | 695 |
| |
695 | 696 |
| |
696 | 697 |
| |
| |||
739 | 740 |
| |
740 | 741 |
| |
741 | 742 |
| |
| 743 | + | |
742 | 744 |
| |
743 | 745 |
| |
744 | 746 |
| |
| |||
763 | 765 |
| |
764 | 766 |
| |
765 | 767 |
| |
| 768 | + | |
766 | 769 |
| |
767 | 770 |
| |
768 | 771 |
| |
|
+6Lines changed: 6 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
31 | 31 |
| |
32 | 32 |
| |
33 | 33 |
| |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
34 | 40 |
| |
35 | 41 |
| |
36 | 42 |
| |
|
You can’t perform that action at this time.
0 commit comments