Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updating Video Assets in the Project #34

Closed
prarthanashr04 opened this issue May 31, 2024 · 1 comment
Closed

Updating Video Assets in the Project #34

prarthanashr04 opened this issue May 31, 2024 · 1 comment

Comments

@prarthanashr04
Copy link

Hello,
I'm encountering an issue with updating video assets in my project. Here's a summary of the problem:
Context: I'm fetching data from an API and updating the video assets in the project.
Problem: Direct updates to the video work fine, but when I search for a video (which involves a server-side search and API call), the strip becomes empty.
Specific Issue: When I update project.assets in editor.vue, the strip is not getting updated. Additionally, I see an "undefined" asset in videostrip.ts after searching, and I'm not sure how the following function is getting called:
afterSearching
beforeSearching

public updateAsset(asset?: VideoAsset) {
console.log(asset, "asset");
this.setCanvasSize();
if (!asset) {
this.video.src = "";
this.loaded = false;
return;
}
this.videoAsset = asset;
this.loaded = false;
asset.valid = false;
const onLoad = () => {
if (!this.canvas) return;
if (this.loaded) return;
this.videoDuration = this.video.duration;
this.canvas.width = this.previewWidth;
this.canvas.height = this.previewHeight;

this.obj.geometry = new T.PlaneGeometry(
  this.canvas.width,
  this.canvas.height
);

this.loaded = true;
asset.valid = true;
this.event.dispatchEvent(new CustomEvent("update"));

};
this.video.onloadedmetadata = () => onLoad();
this.video.src = asset.path;
this.video.load();
}
Additional Context:
The issue seems to occur only after searching.
I suspect the updateAsset function is being called somewhere unexpectedly.
Could you please help me understand how to ensure that the strip gets updated correctly after a search and why the updateAsset function might be receiving an undefined asset?

@toshusai
Copy link
Owner

toshusai commented Jun 3, 2024

I'm sorry, but Vega is a personal project. I can't provide support for the code of projects using Vega.

@toshusai toshusai closed this as completed Jun 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants