feat: add notification controls (#4721)

This commit is contained in:
Krzysztof Moch
2025-10-06 16:36:52 +02:00
committed by GitHub
parent 375fbeb0eb
commit 02044de0e9
43 changed files with 1226 additions and 280 deletions
+8
View File
@@ -146,6 +146,7 @@ const VideoDemo = () => {
player.playWhenInactive = settings.playWhenInactive;
player.mixAudioMode = settings.mixAudioMode;
player.ignoreSilentSwitchMode = settings.ignoreSilentSwitchMode;
player.showNotificationControls = settings.showNotificationControls;
}, [settings, player]);
const handleSeek = (val: number) => {
@@ -315,6 +316,13 @@ const VideoDemo = () => {
value={settings.playWhenInactive}
onValueChange={(value) => updateSetting('playWhenInactive', value)}
/>
<SwitchControl
label="Notification Controls"
value={settings.showNotificationControls}
onValueChange={(value) =>
updateSetting('showNotificationControls', value)
}
/>
</View>
</View>
+2
View File
@@ -17,6 +17,7 @@ export interface VideoSettings {
ignoreSilentSwitchMode: IgnoreSilentSwitchMode;
playInBackground: boolean;
playWhenInactive: boolean;
showNotificationControls: boolean;
}
export const defaultSettings: VideoSettings = {
@@ -32,4 +33,5 @@ export const defaultSettings: VideoSettings = {
ignoreSilentSwitchMode: 'auto',
playInBackground: true,
playWhenInactive: false,
showNotificationControls: true,
};
+9
View File
@@ -103,5 +103,14 @@ export const getVideoSource = (type: VideoType): VideoConfig => {
type: 'vtt',
},
],
metadata: {
title: 'Big Buck Bunny',
artist: 'Blender Foundation',
imageUri:
'https://peach.blender.org/wp-content/uploads/title_anouncement.jpg',
subtitle: 'By the Blender Institute',
description:
'Big Buck Bunny is a short computer-animated comedy film by the Blender Institute, part of the Blender Foundation. It was made using Blender, a free and open-source 3D creation suite.',
},
} as VideoConfig;
};