Open
Conversation
Co-authored-by: Yonathan <yonathandejenee@gmail.com>
Greptile SummaryThis PR correctly fixes the mini player visibility issue by ensuring only audible media triggers the player. The implementation uses a Key implementation details:
The logic correctly handles edge cases including muted autoplay videos, volume changes, and media that becomes audible while playing. Confidence Score: 5/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant Media as Media Element
participant JS as JavaScript Bridge
participant Swift as MediaController
participant UI as Mini Player
Note over Media,UI: Scenario: Muted media becomes audible
Media->>JS: play event (muted)
JS->>JS: isAudible() = false
Note over JS: __oraWasPlayed NOT set
JS->>Swift: state message (wasPlayed: undefined)
Swift->>Swift: Create session (wasPlayed: false)
Note over UI: Mini player NOT visible
Media->>JS: volumechange event (unmuted)
JS->>JS: isAudible() = true
JS->>JS: Set __oraWasPlayed = true
JS->>Swift: state message (wasPlayed: true)
JS->>Swift: volume message
Swift->>Swift: Update session (wasPlayed: true)
Swift->>Swift: isVisible = !visibleSessions.isEmpty
Swift->>UI: Show mini player
Last reviewed commit: 6acf169 |
Co-authored-by: Yonathan <yonathandejenee@gmail.com>
…ub.com/the-ora/browser into tembo/fix-mini-player-trigger-no-media
…ructure Co-authored-by: Yonathan <98046049+yonaries@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixed mini media player being incorrectly triggered on pages without audible media playing (issue #187).
Key changes:
MediaController.swiftto checkvisibleSessions.isEmptyinstead ofsessions.isEmptyfor player visibilityisAudible()helper function inWebViewNavigationDelegate.swiftto check if media element is unmuted and has volume > 0__oraWasPlayed) when it's audible:playevent now checks if media is audible before marking as playedvolumechangeevent marks media as played when becoming audible while playingThis ensures the mini player only appears for media that is actually producing sound.