-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
createVideo() callback could return instance of video #7468
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
Labels
Comments
Quick followup, of course this can be done without the callback by first preloading it – but a small modification would then require less code. let videos = [
'path1.mov',
'path2.mov',
'path3.mov',
'path4.mov',
]
let videoPlayers = []
function preload(){
for(let v of videos){
videoPlayers.push(createVideo('data/videos/' + v))
}
}
function setup() {
createCanvas(windowWidth, windowHeight)
for(let vp of videoPlayers){
vp.volume(0)
vp.loop()
vp.hide()
}
} |
Hey So, am new here would love to help you on fixing this issue here? |
3 tasks
@ffd8 , I've put our a PR to make the changes |
@davepagurek I see the same pattern in 2.0 on p5.MediaElement:1324 - should I make the matching PR there? |
That would be great, thanks! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Increasing access
Make this function more useful, which could have accessibility implications
Most appropriate sub-area of p5.js?
Feature enhancement details
Was just testing loading an array of
createVideo()
, in which each one should be muted, looped and hidden, however I learned that the callback function doesn't include the instance of media to directly affect, rather it expects a single global variable is used. Perhaps this could return as a param the media instance, so that one can directly mute, hide, loop that video once loaded?The text was updated successfully, but these errors were encountered: