Comments (8)
@MatthewShotton
const urlOne = 'rightUrl';
const urlTwo = 'wrongUrl'
const node = this.ctx.video(urlOne, 0, 4, { volume: 0.8, loop: false });
node.startAt(0);
node.stopAt(15);
const nodeTwo = this.ctx.video(urlTwo, 0, 4, { volume: 0.8, loop: false });
nodeTwo.startAt(15);
nodeTwo.stopAt(30);
node.connect(this.ctx.destination);
nodeTwo.connect(this.ctx.destination);
this.ctx.play();
from videocontext.
thanks, VideoContext is still playing when source nodes throws an error after i update it to v0.38.2.It's very helpful for me
from videocontext.
Hi @Statfine
Thanks for raising this. I've just pushed a new release, v0.36.0 which adds an error callback to nodes which will get thrown if content cannot be loaded for a specific node. It can be used like the following:
this.ctx = new VideoContext();
let video = ctx.video("./errorvideo.mp4");
video.start(0);
video.registerCallback("error", (n)=>{
console.log("Error with node", n);
// Destroy the node so it doesn't try and play and cause the videocontext to stall.
n.destroy();
});
The error callbacks will be called as soon as the VideoContext tries to load the source node (this is usually approximately 4 seconds before it is due to be played, and will be shortly after the "load" callback gets triggered on the node).
Currently you have to call destroy()
or resetTimelineState()
on a node which throws an error otherwise the VideoContext will continue trying to play it which will cause the VideoContext to halt.
Does that help with your requirements?
Kind regards,
Matt
from videocontext.
@MatthewShotton can videoContext still play if i don't do n.destroy() when video.registerCallback("error",...); just don't show frame
from videocontext.
@Statfine I've just pushed a change to v0.38.0 which will let the VideoContext continue playing if one of the source nodes throws an error. Let me know if you have any problems with it. Cheers!
from videocontext.
i have update it to v0.38.0; but the VideoContext is not playing when source nodes throws an error, should i use something function to continue
from videocontext.
hi @Statfine , I've pushed v0.38.1 which adds some extra checks for testing if a video node is not valid.
If that doesn't fix the problem are you able to put together a minimal example that demonstrates the problem you're seeing? I'm having trouble re-creating the exact error you have.
from videocontext.
@Statfine I've just published v0.38.2 to npm/github. Let me know if you have any luck with that!
I'm not sure why my original test code failed to catch this, but the code you've sent has replicated the issue well enough to hopefully fix it.
from videocontext.
Related Issues (20)
- What's the easiest way to have a 'poster' image whilst a video initially buffers?
- InvalidAccessError when calling clearTimelineState or destroy in Microsoft Edge HOT 2
- Unhandled Rejection (TypeError): 2 is not a valid argument count for any overload of Window.createImageBitmap
- TypeError: Invalid operand to 'instanceof': Function expected
- imageNode seek registerCallback loaded. is instability
- Expose internal nodes for extending HOT 2
- Live HLS Support
- Empty graph does not clear canvas
- CodeSandbox example error HOT 1
- 多个音频播放有噪音
- Append videos while playing HOT 2
- Video not rendered initially if not cached
- Is there a way to apply the LUT?
- Video stops for a moment.
- Do start, stop functions take only seconds?
- Is it possible to apply LUTs (3D, 1D) via effect node.
- Suggestion: Use WebCodecs API
- How to position element on the canvas? HOT 2
- Typescript conversion? HOT 1
- Connecting multiple videos leads to a performance decline.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from videocontext.