Skip to content

Comments

#201 AnimationToolからのVideoの受け取り処理の型改修#202

Merged
ienaga merged 1 commit intomainfrom
develop
Aug 6, 2025
Merged

#201 AnimationToolからのVideoの受け取り処理の型改修#202
ienaga merged 1 commit intomainfrom
develop

Conversation

@ienaga
Copy link
Member

@ienaga ienaga commented Aug 6, 2025

No description provided.

Copilot AI review requested due to automatic review settings August 6, 2025 23:25
Copy link
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 modifies the type handling for video data reception from AnimationTool by updating the videoData property type to allow null values and adjusting the corresponding usage to access the underlying ArrayBuffer.

  • Updated IVideoCharacter.videoData type to allow null values
  • Modified video blob creation to use videoData.buffer as ArrayBuffer

Reviewed Changes

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

File Description
packages/media/src/interface/IVideoCharacter.ts Updated videoData property to allow null values
packages/media/src/Video/usecase/VideoBuildFromCharacterUseCase.ts Modified blob creation to use videoData.buffer with ArrayBuffer casting

@@ -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.
@ienaga ienaga merged commit 026bf1f into main Aug 6, 2025
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant