-
-
Notifications
You must be signed in to change notification settings - Fork 40
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
feat: 107 use video texture #167
Conversation
✅ Deploy Preview for cientos-tresjs ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks amazing man, really nice work, just add the error handling to the loading of the video, and we can merge
src/core/loaders/useVideoTexture.ts
Outdated
}) | ||
const texture = new VideoTexture(video) | ||
video.addEventListener(unsuspend, () => res(texture)) | ||
video.addEventListener('error', () => rej()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
video.addEventListener('error', () => rej()) | |
video.addEventListener('error', (err) => rej(err)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
src/core/loaders/useVideoTexture.ts
Outdated
} | ||
|
||
function loadTexture(): Promise<VideoTexture> { | ||
return new Promise((res, rej) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As a piece of general advice, try to avoid using acronyms or shorter versions of words when naming variables and methods, is always more important readability vs saving what, couple of letters?
new Promise((resolve, reject) => {
Less cognitive load when reading the code ;)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@JaimeTorrealba please use resolve
and reject
. Avoid shorting variable and method names
src/core/loaders/useVideoTexture.ts
Outdated
} | ||
|
||
function loadTexture(): Promise<VideoTexture> { | ||
return new Promise((res, rej) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@JaimeTorrealba please use resolve
and reject
. Avoid shorting variable and method names
closes #107