Skip to content

Bugfix video playback#1096

Merged
Tlaster merged 4 commits intomasterfrom
bugfix/video_playback
Jul 14, 2025
Merged

Bugfix video playback#1096
Tlaster merged 4 commits intomasterfrom
bugfix/video_playback

Conversation

@Tlaster
Copy link
Copy Markdown
Contributor

@Tlaster Tlaster commented Jul 14, 2025

No description provided.

@Tlaster Tlaster requested a review from Copilot July 14, 2025 05:55
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR addresses issues in video playback by refining how volume and audio attributes are set in VideoPlayer, and disables video autoplay in the profile media tab.

  • Refactored volume and audio-attribute logic using DisposableEffect and removed an unused import.
  • Wrapped media items in ProfileScreen with a CompositionLocalProvider to set videoAutoplay = NEVER.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
shared/ui/component/src/androidMain/kotlin/dev/dimension/flare/ui/component/VideoPlayer.kt Removed unused import; switched from LaunchedEffect to DisposableEffect for volume and audio-attribute management.
desktopApp/src/main/kotlin/dev/dimension/flare/ui/screen/home/ProfileScreen.kt Added CompositionLocalProvider to override videoAutoplay for media items in the profile media tab.
Comments suppressed due to low confidence (2)

desktopApp/src/main/kotlin/dev/dimension/flare/ui/screen/home/ProfileScreen.kt:206

  • [nitpick] Only videoAutoplay is overridden while inheriting all other fields from the current appearance. Ensure that inheriting other settings won’t introduce unintended styling or behavior in this context.
                                        LocalComponentAppearance.current.copy(

shared/ui/component/src/androidMain/kotlin/dev/dimension/flare/ui/component/VideoPlayer.kt:116

  • [nitpick] The .apply block duplicates volume assignment already handled by the DisposableEffect, so you can remove it to simplify initialization and avoid redundancy.
                    }

player.setAudioAttributes(audioAttributes, true)
}
onDispose {
player.setAudioAttributes(audioAttributes, false)
Copy link

Copilot AI Jul 14, 2025

Choose a reason for hiding this comment

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

Currently only the audio attributes are reset on dispose, but the player’s volume remains unchanged. Consider resetting the volume on dispose as well to avoid lingering state if this player instance is reused.

Suggested change
player.setAudioAttributes(audioAttributes, false)
player.setAudioAttributes(audioAttributes, false)
player.volume = 1f // Reset volume to default

Copilot uses AI. Check for mistakes.
.clickable {
val content = item.status.content
if (content is UiTimeline.ItemContent.Status) {
CompositionLocalProvider(
Copy link

Copilot AI Jul 14, 2025

Choose a reason for hiding this comment

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

[nitpick] The CompositionLocalProvider is applied for each media item, which could add overhead. Consider hoisting it to a higher scope so it wraps the entire list rather than individual items.

Copilot uses AI. Check for mistakes.
.clickable {
val content = item.status.content
if (content is UiTimeline.ItemContent.Status) {
CompositionLocalProvider(
Copy link

Copilot AI Jul 14, 2025

Choose a reason for hiding this comment

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

[nitpick] This nested CompositionLocalProvider adds extra indentation and nested braces. You might extract this into a small helper composable to improve readability and reduce nesting.

Copilot uses AI. Check for mistakes.
@Tlaster Tlaster enabled auto-merge July 14, 2025 05:57
@Tlaster Tlaster disabled auto-merge July 14, 2025 06:06
@Tlaster Tlaster enabled auto-merge July 14, 2025 06:20
@Tlaster Tlaster merged commit a8a06b4 into master Jul 14, 2025
4 checks passed
@Tlaster Tlaster deleted the bugfix/video_playback branch July 14, 2025 06:39
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