mirror of
https://github.com/PR0M3TH3AN/bitvid.git
synced 2026-10-27 16:02:26 +00:00
### Motivation
- Prevent a browser-policy muted-autoplay retry from overwriting a viewer's explicit mute/unmute preference and ensure fallback mutes are transient.
- Ensure that when a user logs in while a video comment modal is open, the open thread is reloaded (not just refreshed) so comments continue to display correctly after relay-backed services are reconfigured.
### Description
- Add `js/utils/autoplayPreference.js` with `muteForAutoplayFallback` and `consumeAutoplayFallbackMute` helpers to mark and consume transient fallback mutes.
- Update `js/services/playbackService.js` to treat sound as default unless the viewer explicitly chose mute, persist explicit choices via `localStorage`, ignore fallback-generated volume changes using `consumeAutoplayFallbackMute`, and expose `muteForAutoplayFallback` delegating to the new util.
- Replace direct `videoElement.muted = true` calls with `playbackService.muteForAutoplayFallback` in `js/app/playbackCoordinator.js` and `js/webtorrent.js` so fallback mutes are marked as transient.
- Change `js/app/authSessionCoordinator.js` to reload the currently open video comment thread with `commentController.load(activeModalVideo)` after login if a modal video is active, instead of only calling `refreshAuthState`.
- Update tests in `tests/services/playbackService.test.mjs` and add a test in `tests/app/login-defers-dms.test.mjs` to cover the login behavior that reloads an open comment thread.
### Testing
- Ran the `PlaybackService` unit tests (`tests/services/playbackService.test.mjs`) which assert `prepareVideoElement` behavior, explicit mute persistence, and the transient nature of fallback mute, and they passed.
- Ran the auth login unit tests including `tests/app/login-defers-dms.test.mjs` which verifies DM deferral and reload of an open comment thread, and they passed.
(cherry picked from commit ce14004725)
29 lines
960 B
JavaScript
29 lines
960 B
JavaScript
// js/feedEngine/index.js
|
|
|
|
export { createFeedEngine } from "./engine.js";
|
|
export {
|
|
createDedupeByRootStage,
|
|
createBlacklistFilterStage,
|
|
createDisinterestFilterStage,
|
|
createTagPreferenceFilterStage,
|
|
createWatchHistorySuppressionStage,
|
|
createModerationStage,
|
|
createResolvePostedAtStage,
|
|
} from "./stages.js";
|
|
export { createExploreScorerStage, createForYouScorerStage } from "./exploreScoring.js";
|
|
export { createKidsScorerStage } from "./kidsScoring.js";
|
|
export { createKidsAudienceFilterStage } from "./kidsAudienceFilterStage.js";
|
|
export {
|
|
createChronologicalSorter,
|
|
createForYouScoreSorter,
|
|
createExploreDiversitySorter,
|
|
createKidsScoreSorter,
|
|
} from "./sorters.js";
|
|
export {
|
|
createActiveNostrSource,
|
|
createWhitelistedAuthorsNostrSource,
|
|
createSubscriptionAuthorsSource,
|
|
createWatchHistoryPointerSource,
|
|
} from "./sources.js";
|
|
export { createWatchHistoryFeedDefinition, registerWatchHistoryFeed } from "./watchHistoryFeed.js";
|