Skip to content

Commit b4e7f35

Browse files
committed
feat: fullscreen support for media chrome
1 parent b000cdc commit b4e7f35

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

lib/video-moq/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ export class VideoMoq extends HTMLElement {
7979

8080
set fullscreen(fullscreen: boolean) {
8181
if (fullscreen) {
82-
this.enterFullscreen().catch((err) => {
82+
this.requestFullscreen().catch((err) => {
8383
console.error("Error entering fullscreen:", err)
8484
})
8585
} else {
@@ -455,7 +455,7 @@ export class VideoMoq extends HTMLElement {
455455
this.fullscreen = !document.fullscreenElement
456456
}
457457

458-
private async enterFullscreen() {
458+
public async requestFullscreen(): Promise<void> {
459459
try {
460460
if (this.#base) {
461461
await this.#base.requestFullscreen()
@@ -465,7 +465,7 @@ export class VideoMoq extends HTMLElement {
465465
}
466466
}
467467

468-
private async exitFullscreen() {
468+
public async exitFullscreen(): Promise<void> {
469469
try {
470470
await document.exitFullscreen()
471471
} catch (error) {

samples/media-chrome/media-chrome.html

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ <h1>Media Chrome Example</h1>
1616
<video-moq
1717
src="https://localhost:4443?namespace=bbb"
1818
fingerprint="https://localhost:4443/fingerprint"
19-
width="640px"
2019
slot="media"
2120
></video-moq>
2221
<media-control-bar>
@@ -29,11 +28,10 @@ <h1>Media Chrome Example</h1>
2928
</media-controller> -->
3029

3130
<!-- Using media-theme -->
32-
<media-theme-x-mas>
31+
<media-theme-x-mas style="width: 640px">
3332
<video-moq
3433
src="https://localhost:4443?namespace=bbb"
3534
fingerprint="https://localhost:4443/fingerprint"
36-
width="640px"
3735
slot="media"
3836
></video-moq>
3937
</media-theme-x-mas>

0 commit comments

Comments
 (0)