Skip to content

cobalt: Add dual Picture-in-Picture demo#11526

Open
GillianZili wants to merge 1 commit into
youtube:mainfrom
GillianZili:cobalt-pip-dual-demo
Open

cobalt: Add dual Picture-in-Picture demo#11526
GillianZili wants to merge 1 commit into
youtube:mainfrom
GillianZili:cobalt-pip-dual-demo

Conversation

@GillianZili

@GillianZili GillianZili commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Add a demonstration of simultaneous video playback using both texture-
and overlay-based decoders. This demo showcases Cobalt's ability to
manage multiple media streams and transitions between side-by-side
layouts and native Picture-in-Picture modes.

The application provides a reference for handling mixed rendering paths
and ensuring compositor stability during layout changes. This helps
validate multi-video support and rendering behavior when switching
between display modes.

Issue: 445194225

@GillianZili
GillianZili requested a review from borongc July 23, 2026 22:31
@github-actions

Copy link
Copy Markdown
Contributor

🤖 Gemini Suggested Commit Message


cobalt: Add dual Picture-in-Picture demo

Add a demonstration of simultaneous video playback using both texture-
and overlay-based decoders. This demo showcases Cobalt's ability to
manage multiple media streams and transitions between side-by-side
layouts and native Picture-in-Picture modes.

The application provides a reference for handling mixed rendering paths
and ensuring compositor stability during layout changes. This helps
validate multi-video support and rendering behavior when switching
between display modes.

Bug: 11526

💡 Pro Tips for a Better Commit Message:

  1. Influence the Result: Want to change the output? You can write custom prompts or instructions directly in the Pull Request description. The model uses that text to generate the message.
  2. Re-run the Generator: Post a comment with: /generate-commit-message

@GillianZili

Copy link
Copy Markdown
Contributor Author

/gemini review

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a dual Picture-in-Picture (PiP) demo for Cobalt, consisting of an HTML file and a JavaScript file that manage side-by-side and PiP/fullscreen video transitions. The review feedback is highly constructive and focuses on improving robustness and compatibility for TV environments. Key recommendations include restricting the keydown event listener to specific keys (like 'Enter' or 'Space') to prevent breaking device navigation, merging duplicate CSS declarations for .video-container, refactoring the async Promise executor anti-pattern in bootstrapVideo, and adding safety checks for network responses and the availability of the Picture-in-Picture API.

Comment thread cobalt/demos/content/picture-in-picture-demo/dual-pip-demo.js
Comment thread cobalt/demos/content/picture-in-picture-demo/dual-pip-demo.html
Comment thread cobalt/demos/content/picture-in-picture-demo/dual-pip-demo.js Outdated
Comment thread cobalt/demos/content/picture-in-picture-demo/dual-pip-demo.js
Comment thread cobalt/demos/content/picture-in-picture-demo/dual-pip-demo.js Outdated
@GillianZili
GillianZili force-pushed the cobalt-pip-dual-demo branch from 187f19e to 7706fcb Compare July 24, 2026 17:22
@GillianZili
GillianZili marked this pull request as ready for review July 24, 2026 17:24

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a dual Picture-in-Picture (PiP) demo for Cobalt, featuring an HTML layout and a JavaScript controller that manages a texture-mode video and an overlay-mode video. The review feedback highlights a few key issues in the JavaScript implementation: an error-handling bug where a failed PiP request still triggers a fullscreen transition, an inline style override on the second video that prevents it from correctly sizing to 100% in fullscreen, and an unused currentStage variable that should be removed.

Comment thread cobalt/demos/content/picture-in-picture-demo/dual-pip-demo.js
Comment thread cobalt/demos/content/picture-in-picture-demo/dual-pip-demo.js
Comment thread cobalt/demos/content/picture-in-picture-demo/dual-pip-demo.js Outdated
@GillianZili
GillianZili force-pushed the cobalt-pip-dual-demo branch from 7706fcb to 49a9e48 Compare July 24, 2026 17:56
}

// Use local file for PiP texture to ensure EGL stability, and Sintel for the overlay!
const url1 = 'vp9-720p.webm';

@borongc borongc Jul 24, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider to replace with another video that is more vivid. This one has a static white screen, making PiP window less vivid.

@GillianZili
GillianZili force-pushed the cobalt-pip-dual-demo branch from 49a9e48 to a232f1a Compare July 26, 2026 18:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants