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

feat: 107 use video texture #167

Merged
merged 7 commits into from
Aug 21, 2023
Merged

feat: 107 use video texture #167

merged 7 commits into from
Aug 21, 2023

Conversation

JaimeTorrealba
Copy link
Member

closes #107

@netlify
Copy link

netlify bot commented Aug 11, 2023

Deploy Preview for cientos-tresjs ready!

Name Link
🔨 Latest commit adcc8dc
🔍 Latest deploy log https://app.netlify.com/sites/cientos-tresjs/deploys/64e3840563c1300008ed5b30
😎 Deploy Preview https://deploy-preview-167--cientos-tresjs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link
Member

@alvarosabu alvarosabu left a 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 Show resolved Hide resolved
})
const texture = new VideoTexture(video)
video.addEventListener(unsuspend, () => res(texture))
video.addEventListener('error', () => rej())
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
video.addEventListener('error', () => rej())
video.addEventListener('error', (err) => rej(err))

Copy link
Member Author

Choose a reason for hiding this comment

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

The error object is pretty much useless, so I'll keep the error log message

image

}

function loadTexture(): Promise<VideoTexture> {
return new Promise((res, rej) => {
Copy link
Member

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 ;)

Copy link
Member

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

}

function loadTexture(): Promise<VideoTexture> {
return new Promise((res, rej) => {
Copy link
Member

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

@alvarosabu alvarosabu merged commit f0f1f9b into main Aug 21, 2023
6 checks passed
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

Successfully merging this pull request may close these issues.

UseVideoTexture
2 participants