Comments (10)
@MatthewShotton crossFade is ok but crossFade2 is not work, and after end do replay node2 is show "nocontent"
from videocontext.
@Statfine Hi!,
Your crossFade2 doesn't work because it only has one input connected to it.
The simplest way to fix this is to connect crossFade to the first input of crossFade2 instead of connecting it to the destination:
node.connect(crossFade);
node2.connect(crossFade);
crossFade.transition(5, 10, 0.0, 1.0);
crossFade.connect(crossFade2); //connect to input of crossfade2 rather than destination.
node3.connect(crossFade2);
crossFade2.connect(this.ctx.destination);
crossFade2.transition(15, 20, 0.0, 1.0);
I will have a look into the bug affecting the replay shortly.
Kind regards,
Matt
from videocontext.
Also, this file:
https://github.com/bbc/VideoContext/blob/master/docs/js/utils.js
Has some useful code for creating a visualisation of the videocontext's timeline and graph which can be useful for debugging.
It will create diagrams like on the bottom of this page: http://bbc.github.io/VideoContext/examples/transitions.html
from videocontext.
@Statfine
I've pushed a fix for the "nocontent" being fired when replaying the composition as 0.38.3 to npm and github.
This was due to the underlying video element being set to undefined when a node had finished playing, which caused an error callback to be called on the underlying video element and the video node to be incorrectly tagged as being in an error state.
from videocontext.
thanks; it's good for me
from videocontext.
@MatthewShotton
I have another question,at the end of the video to achieve special effects, i can do like this
const node = this.ctx.video('mp4');
node.startAt(0);
node.stopAt(10);
const crossFade = this.ctx.transition(VideoContext.DEFINITIONS.CROSSFADE); // 渐显
node.connect(crossFade);
crossFade.connect(this.ctx.destination);
crossFade.transition(7, 10, 0.0, 1.0);
but if i want at the begin of the video to achieve special effects; what can i do?? l have change crossFade.transition(0, 3, 0.0, 1.0); but it's not well
from videocontext.
@Statfine you can swap around the last two parameters like so:
crossFade.transition(0, 3, 1.0, 0.0);
The last two parameters define what to change the mix parameter from and to. So in this new code the transition is happening from the second input to the first input.
The definition file for the crossfade should give some insight into what is going on (if you look in the "fragmentShader" section "color_a" is the first input and "color_b" as the second input):
https://github.com/bbc/VideoContext/blob/master/src/Definitions/crossfade.js
Hope that makes sense!
from videocontext.
so shouldn't used this function if there is only one input?
from videocontext.
If there's only one input the other input will default to being transparent, so you can use it with only one input if you like. It depends on what effect you are looking to achieve!
from videocontext.
@MatthewShotton Oh, I see,thank you very much
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.