Before you continue
Before submitting a bug report, please review our troubleshooting documentation at Troubleshoot Issues | Vega Troubleshooting
If you still want to file a bug report, please make sure to fill in all the details below and provide the necessary information.
NOTE: PLEASE ONLY REPORT A SINGLE BUG USING THIS TEMPLATE.
If youβre experiencing multiple issues, please file a separate report for each.
Bug Description
1. Summary
Player crashes on playing.
App Name: Vix
App Link on Amazon Appstore (found through Developer Console β Actions column in App List β View on Amazon.com):
Bug Severity
Select one that applies
- Impacts operation of app
- Blocks current development
- Improvement suggestion
- Issue with documentation (If selected, please share the doc link and describe the issue)
- Other
2. Steps to Reproduce
Reproduce player. Observe behaviour.
3. Observed Behavior
Explain what actually happened, noting any discrepancies or malfunctions.
Full crash of app.
4. Expected Behavior
Describe what you expected the SDK to do under normal operation.
Player wont crash.
4.a Possible Root Cause & Temporary Workaround
Fill out anything you have tried. If you donβt know, N/A is acceptable
Nothing.
5. Logs or crash report
(Please make sure to provide relevant logs as attachment)
396#crash_1777188064_30037_5000_330905_451615411_JSThread_235.acr (648.5 KB)
For crash issues, please refer this guide for faster troubleshooting: Detect Where the App Crash Originates | Design and Develop Vega Apps
-
For issues with Vega Studio Extension, please share log files from below folders:
For v0.22+:~/.vscode/extensions/amazon.vega-extension-<version>/ExtensionLogs ~/.vscode/extensions/amazon.vega-ui-extension-<version>/ExtensionLogsFor v0.21 and earlier:
~/.vscode/extensions/amazon.kepler-extension-<version>/ExtensionLogs ~/.vscode/extensions/amazon.kepler-ui-extension-<version>/ExtensionLogs
6. Environment
Please fill out the fields related to your bug below:
-
SDK Version: Run
vega --version(v0.22+) orkepler --version(v0.21 and earlier) and paste output -
Active SDK Version: 0.22.6006
Vega CLI Version: 1.2.18
-
App State:
[Foreground/Background] -
OS Information: Please ssh into the device via
vega exec vda shell(orkepler exec vda shellfor v0.21 and earlier) and copy the output fromcat /etc/os-releaseinto the answer section below. Note, if you donβt have a simulator running or device attached, the command will respond withvda: no devices/emulators found<!-- Answer here if applicable -->
7. Example Code Snippet / Screenshots / Screengrabs
Include any relevant code or component setup in React Native that can help reproduce the bug.
/* eslint-disable jsdoc/require-description */
/* eslint-disable jsdoc/require-param-description */
/* eslint-disable react-native/no-inline-styles */
import React, {
useCallback, useEffect, useMemo, useRef, useState,
} from 'react';
import { BackHandler, Pressable, View } from 'react-native';
import { useNavigation } from '@amazon-devices/react-navigation__core';
import { VideoPlayer, KeplerVideoSurfaceView } from '@amazon-devices/react-native-w3cmedia';
import Text from 'src/components/atoms/Text/Text';
import getStyles from './PlayerScreenLight.styles';
/**
* @param seconds
*/
function formatTime(seconds: number): string {
if (!Number.isFinite(seconds) || seconds < 0) return '0:00';
const m = Math.floor(seconds / 60);
const s = Math.floor(seconds % 60);
return `${m}:${s.toString().padStart(2, '0')}`;
}
/**
* Player Screen Light component
*/
function PlayerScreenLight(): JSX.Element {
const styles = useMemo(() => getStyles(), []);
const navigation = useNavigation();
const video = useRef<VideoPlayer | null>(null);
const progressInterval = useRef<ReturnType<typeof setInterval> | null>(null);
const [isPlaying, setIsPlaying] = useState(false);
const [currentTime, setCurrentTime] = useState(0);
const [duration, setDuration] = useState(0);
// βββ init βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
useEffect(() => {
const player = new VideoPlayer();
video.current = player;
return () => {
if (progressInterval.current) {
clearInterval(progressInterval.current);
progressInterval.current = null;
}
player.deinitialize().catch((e) => console.error('Error en deinitialize:', e));
video.current = null;
};
}, []);
// βββ surface callbacks ββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
const onSurfaceViewCreated = useCallback(async (surfaceHandle: string) => {
if (!video.current) return;
await video.current.initialize();
video.current.addEventListener('loadedmetadata', () => {
const dur = video.current?.duration ?? 0;
if (dur > 0) setDuration(dur);
});
video.current.src = 'https://www.w3schools.com/html/mov_bbb.mp4';
video.current.setSurfaceHandle(surfaceHandle);
await video.current.play();
setIsPlaying(true);
setCurrentTime(0);
progressInterval.current = setInterval(() => {
if (!video.current) return;
setCurrentTime(video.current.currentTime ?? 0);
const dur = video.current.duration ?? 0;
if (dur > 0) setDuration(dur);
}, 500);
}, []);
const onSurfaceViewDestroyed = useCallback((_surfaceHandle: string) => {
video.current?.clearSurfaceHandle(_surfaceHandle);
if (progressInterval.current) {
clearInterval(progressInterval.current);
progressInterval.current = null;
}
setIsPlaying(false);
}, []);
// βββ controls ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
const handlePlayPause = useCallback(async () => {
if (!video.current) return;
if (isPlaying) {
video.current.pause();
setIsPlaying(false);
} else {
await video.current.play();
setIsPlaying(true);
}
}, [isPlaying]);
const handleBackPress = useCallback(() => {
if (navigation.canGoBack()) navigation.goBack();
}, [navigation]);
useEffect(() => {
const onBackPress = () => { void handleBackPress(); return true; };
const sub = BackHandler.addEventListener('hardwareBackPress', onBackPress);
return () => sub.remove();
}, [handleBackPress]);
// βββ render βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
const progress = duration > 0 ? Math.min(currentTime / duration, 1) : 0;
return (
<View style={{ flex: 1, backgroundColor: 'black' }}>
<KeplerVideoSurfaceView
style={{ flex: 1 }}
scalingmode="fit"
onSurfaceViewCreated={onSurfaceViewCreated}
onSurfaceViewDestroyed={onSurfaceViewDestroyed}
/>
<View style={{
position: 'absolute',
bottom: 0,
left: 0,
right: 0,
paddingHorizontal: 20,
paddingBottom: 36,
paddingTop: 16,
backgroundColor: 'rgba(0,0,0,0.55)',
}}>
{/* Progress bar */}
<View style={{
height: 3,
backgroundColor: 'rgba(255,255,255,0.25)',
borderRadius: 2,
marginBottom: 10,
}}>
<View style={{
height: 3,
width: `${progress * 100}%`,
backgroundColor: '#fff',
borderRadius: 2,
}} />
</View>
{/* Time */}
<View style={{ flexDirection: 'row', justifyContent: 'space-between', marginBottom: 12 }}>
<Text style={{ color: 'rgba(255,255,255,0.85)', fontSize: 12, fontVariant: ['tabular-nums'] }}>
{formatTime(currentTime)}
</Text>
<Text style={{ color: 'rgba(255,255,255,0.85)', fontSize: 12, fontVariant: ['tabular-nums'] }}>
{duration > 0 ? formatTime(duration) : '--:--'}
</Text>
</View>
{/* Play/Pause */}
<View style={{ alignItems: 'center' }}>
<Pressable
onPress={handlePlayPause}
style={({ pressed }) => ({
width: 56,
height: 56,
borderRadius: 28,
backgroundColor: pressed ? 'rgba(255,255,255,0.9)' : 'rgba(255,255,255,0.75)',
justifyContent: 'center',
alignItems: 'center',
})}
accessibilityLabel={isPlaying ? 'Pausar video' : 'Reproducir video'}
accessibilityRole="button"
>
<Text style={{ fontSize: 22, color: 'black' }}>
{isPlaying ? 'βΈ' : 'βΆ'}
</Text>
</Pressable>
</View>
</View>
</View>
);
}
export default PlayerScreenLight;
Playback Issues
If this is a playback issue, please provide your content URL, any pre-conditions (like geo-location), and let us know if itβs x86 or arm7.
<!-- Describe your playback issue if applicable -->
Please share the following details in addition:_
- Player SDK:
[Bitmovin, Shaka, ...] - Player SDK Version:
[e.g. 1.23]- Audio Codecs:
[AAC, ...] - Video Codecs:
[h.264, mp4] - Manifest Types:
[m3u8, dash, etc ..]
- Audio Codecs:
Q: If applicable, please provide your media/content url
If this is created dynamically, tokenized, etc please provide a way for us to access it
[N/A or Content / Media Url for testing]
Q: Are there any special headers required to reproduce the issue you are facing?
[N/A or Insert Headers]
Additionally please provide the following if possible
Provide Screenshots / Screengrabs / Logs. Please include as much information as you can that will help debug.
<!-- Answer here if applicable -->
Additional Context
Any Additional Context you would like to provide?
Add any other relevant information, such as recent updates to the SDK, dependencies, or device OS that may affect the bug.
<!-- Answer here if applicable -->