Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export const execute = (video: Video, character: IVideoCharacter): void =>
video.volume = character.volume;

Copy link

Copilot AI Aug 6, 2025

Choose a reason for hiding this comment

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

Potential null pointer exception when accessing character.videoData.buffer. Since videoData can now be null (as per the interface update), this will throw an error if character.videoData is null. Add a null check before accessing the buffer property.

Suggested change
if (!character.videoData) return;

Copilot uses AI. Check for mistakes.
video.src = URL.createObjectURL(new Blob(
[character.videoData],
[character.videoData.buffer as ArrayBuffer],
Copy link

Copilot AI Aug 6, 2025

Choose a reason for hiding this comment

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

The type casting as ArrayBuffer suggests uncertainty about the actual type. Consider using proper type guards or validation to ensure the buffer property exists and is of the expected type before casting.

Suggested change
[character.videoData.buffer as ArrayBuffer],
[ArrayBuffer.isView(character.videoData) ? character.videoData.buffer : new ArrayBuffer(0)],

Copilot uses AI. Check for mistakes.
{ "type": "video/mp4" }
));
};
2 changes: 1 addition & 1 deletion packages/media/src/interface/IVideoCharacter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export interface IVideoCharacter {
symbol?: string;
extends: string;
buffer: number[] | null;
videoData: Uint8Array;
videoData: null | Uint8Array;
volume: number;
loop: boolean;
autoPlay: boolean;
Expand Down
Loading