Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ final class MediaController: ObservableObject {
break
}

isVisible = !sessions.isEmpty
isVisible = !visibleSessions.isEmpty
}

// MARK: - Controls (per session, default to primary)
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -118,22 +118,35 @@ let navigationScript = """
observer.observe(document.body, { childList: true, subtree: true });
}

function isAudible(el) {
return !el.muted && el.volume > 0;
}

function attach(el) {
if (!el || el.__oraAttached) return;
el.__oraAttached = true;
const update = () => post(stateFrom(el));
el.addEventListener('play', ()=>{
el.addEventListener('play', () => {
if (isAudible(el)) {
el.__oraWasPlayed = true;
}
update();
el.__oraWasPlayed = true;
});
el.addEventListener('pause', update);
el.addEventListener('ended', () => post({ type: 'ended' }));
el.addEventListener('volumechange', () =>
post({ type: 'volume', volume: el.muted ? 0 : el.volume })
);
// If already playing, announce
el.addEventListener('volumechange', () => {
// Mark as played when becoming audible while playing
if (!el.paused && isAudible(el) && !el.__oraWasPlayed) {
el.__oraWasPlayed = true;
update();
}
post({ type: 'volume', volume: el.muted ? 0 : el.volume });
});
// If already playing, only mark as played if audible
if (!el.paused) {
el.__oraWasPlayed = true;
if (isAudible(el)) {
el.__oraWasPlayed = true;
}
update();
Comment on lines +129 to 150
Copy link

Copilot AI Mar 2, 2026

Choose a reason for hiding this comment

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

The PR description says the mini player should only appear for media that is actually producing sound, but __oraWasPlayed is a latched flag that never gets cleared when audio becomes inaudible again (muted/volume 0). If visibility is intended to track current audibility, you’ll need to either (a) post an explicit isAudible/isMuted state to Swift and filter on that, or (b) clear __oraWasPlayed on volumechange when the element becomes inaudible and send an updated state.

Copilot uses AI. Check for mistakes.
}
watchRemoval(el, () => post({ type: 'removed' }));
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
20 changes: 10 additions & 10 deletions project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ targets:
sources:
- path: ora
excludes:
- "Icons/**"
- "Assets/Icons/**"
resources:
- path: ora/Modules/EmojiPicker/emoji-set.json
- path: ora/Shared/EmojiPicker/emoji-set.json
- path: ora/Resources
optional: true
dependencies:
Expand All @@ -34,14 +34,14 @@ targets:
preBuildScripts:
- name: "Copy Icon Bundle"
inputFiles:
- "$(SRCROOT)/ora/Icons/OraIcon.icon"
- "$(SRCROOT)/ora/Icons/OraIconDev.icon"
- "$(SRCROOT)/ora/Assets/Icons/OraIcon.icon"
- "$(SRCROOT)/ora/Assets/Icons/OraIconDev.icon"
outputFiles:
- "$(BUILT_PRODUCTS_DIR)/$(PRODUCT_NAME).app/Contents/Resources/OraIcon.icon"
- "$(BUILT_PRODUCTS_DIR)/$(PRODUCT_NAME).app/Contents/Resources/OraIconDev.icon"
script: |
ICON_SRC_DEV="$SRCROOT/ora/Icons/OraIconDev.icon"
ICON_SRC_RELEASE="$SRCROOT/ora/Icons/OraIcon.icon"
ICON_SRC_DEV="$SRCROOT/ora/Assets/Icons/OraIconDev.icon"
ICON_SRC_RELEASE="$SRCROOT/ora/Assets/Icons/OraIcon.icon"
ICON_DST="$BUILT_PRODUCTS_DIR/$PRODUCT_NAME.app/Contents/Resources/"
if [ "$CONFIGURATION" = "Debug" ]; then
echo "Using OraIconDev.icon for Debug build"
Expand All @@ -52,7 +52,7 @@ targets:
fi

info:
path: ora/Info.plist
path: ora/Info/Info.plist
properties:
SUFeedURL: "https://the-ora.github.io/browser/appcast.xml"
SUPublicEDKey: "Ozj+rezzbJAD76RfajtfQ7rFojJbpFSCl/0DcFSBCTI="
Expand Down Expand Up @@ -86,7 +86,7 @@ targets:
LSApplicationCategoryType: public.app-category.web-browser

entitlements:
path: ora/ora.entitlements
path: ora/Info/ora.entitlements
properties:
com.apple.security.app-sandbox: true
com.apple.security.assets.movies.read-only: true
Expand Down Expand Up @@ -115,12 +115,12 @@ targets:
configs:
Debug:
ASSETCATALOG_COMPILER_APPICON_NAME: OraIconDev
CODE_SIGN_ENTITLEMENTS: ora/ora-debug.entitlements
CODE_SIGN_ENTITLEMENTS: ora/Info/ora-debug.entitlements
EMIT_FRONTEND_COMMAND_LINES: YES
OTHER_LDFLAGS: "-Xlinker -interposable"
Release:
ASSETCATALOG_COMPILER_APPICON_NAME: OraIcon
CODE_SIGN_ENTITLEMENTS: ora/ora.entitlements
CODE_SIGN_ENTITLEMENTS: ora/Info/ora.entitlements

schemes:
ora:
Expand Down
Loading