feat(shared-media): show volume controls to all participants
Previously only the media owner could see playback controls (including volume). Now all participants see native controls so they can adjust their local volume independently. Playback sync still overrides non-owner play/pause/seek actions. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
f40b8bd97d
commit
65c4a1acf0
|
|
@ -48,14 +48,24 @@
|
||||||
height: 100%;
|
height: 100%;
|
||||||
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
||||||
display: flex;
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
|
gap: 12px;
|
||||||
|
|
||||||
&::before {
|
&::before {
|
||||||
content: '🎵';
|
content: '🎵';
|
||||||
font-size: 48px;
|
font-size: 48px;
|
||||||
opacity: 0.5;
|
opacity: 0.5;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
audio {
|
||||||
|
width: 90%;
|
||||||
|
max-width: 320px;
|
||||||
|
height: 36px;
|
||||||
|
border-radius: 18px;
|
||||||
|
z-index: 1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.shared-music-controls-overlay {
|
.shared-music-controls-overlay {
|
||||||
|
|
|
||||||
|
|
@ -179,7 +179,7 @@ class DirectAudioManager extends AbstractMusicManager {
|
||||||
let options: any = {
|
let options: any = {
|
||||||
autoPlay: true,
|
autoPlay: true,
|
||||||
src: musicId,
|
src: musicId,
|
||||||
controls: _isOwner,
|
controls: true,
|
||||||
onError: () => this.onError(),
|
onError: () => this.onError(),
|
||||||
onPlay: () => this.onPlay(),
|
onPlay: () => this.onPlay(),
|
||||||
onVolumeChange: () => this.onVolumeChange()
|
onVolumeChange: () => this.onVolumeChange()
|
||||||
|
|
@ -204,9 +204,9 @@ class DirectAudioManager extends AbstractMusicManager {
|
||||||
override render() {
|
override render() {
|
||||||
return (
|
return (
|
||||||
<audio
|
<audio
|
||||||
className = 'hide'
|
|
||||||
id = 'sharedMusicPlayer'
|
id = 'sharedMusicPlayer'
|
||||||
ref = { this.audioRef }
|
ref = { this.audioRef }
|
||||||
|
style = {{ width: '100%' }}
|
||||||
{ ...this.getPlayerOptions() } />
|
{ ...this.getPlayerOptions() } />
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -188,8 +188,8 @@ class YouTubeMusicManager extends AbstractMusicManager {
|
||||||
* @returns {Object}
|
* @returns {Object}
|
||||||
*/
|
*/
|
||||||
getPlayerOptions = () => {
|
getPlayerOptions = () => {
|
||||||
const { _isOwner, musicId } = this.props;
|
const { musicId } = this.props;
|
||||||
const showControls = _isOwner ? 1 : 0;
|
const showControls = 1;
|
||||||
|
|
||||||
const options = {
|
const options = {
|
||||||
id: 'sharedMusicPlayer',
|
id: 'sharedMusicPlayer',
|
||||||
|
|
|
||||||
|
|
@ -148,7 +148,7 @@ class VideoManager extends AbstractVideoManager {
|
||||||
let options: any = {
|
let options: any = {
|
||||||
autoPlay: true,
|
autoPlay: true,
|
||||||
src: videoId,
|
src: videoId,
|
||||||
controls: _isOwner,
|
controls: true,
|
||||||
onError: () => this.onError(),
|
onError: () => this.onError(),
|
||||||
onPlay: () => this.onPlay(),
|
onPlay: () => this.onPlay(),
|
||||||
onVolumeChange: () => this.onVolumeChange()
|
onVolumeChange: () => this.onVolumeChange()
|
||||||
|
|
|
||||||
|
|
@ -189,8 +189,8 @@ class YoutubeVideoManager extends AbstractVideoManager {
|
||||||
};
|
};
|
||||||
|
|
||||||
getPlayerOptions = () => {
|
getPlayerOptions = () => {
|
||||||
const { _isOwner, videoId } = this.props;
|
const { videoId } = this.props;
|
||||||
const showControls = _isOwner ? 1 : 0;
|
const showControls = 1;
|
||||||
|
|
||||||
const options = {
|
const options = {
|
||||||
id: 'sharedVideoPlayer',
|
id: 'sharedVideoPlayer',
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue