mirror of
https://github.com/processing/processing4.git
synced 2026-01-30 11:51:54 +01:00
JavaScript mode examples updated for Processing 1.4.0
This commit is contained in:
@@ -4,7 +4,7 @@ window.onload = function () {
|
||||
var audioNode = document.getElementsByTagName("audio")[0];
|
||||
|
||||
function tryFindSketch () {
|
||||
var sketch = Processing.instances[0];
|
||||
var sketch = Processing.getInstanceById(getProcessingSketchID());
|
||||
if ( sketch == undefined )
|
||||
setTimeout(tryFindSketch,200); // retry
|
||||
else
|
||||
|
||||
@@ -6,7 +6,7 @@ window.onload = function () {
|
||||
|
||||
// try and find the sketch
|
||||
function tryLinkSketch() {
|
||||
var sketch = Processing.instances[0];
|
||||
var sketch = Processing.getInstanceById( getProcessingSketchID() );
|
||||
if ( sketch == undefined )
|
||||
setTimeout(tryLinkSketch, 200); /*try again later*/
|
||||
else {
|
||||
|
||||
@@ -6,7 +6,7 @@ window.onload = function () {
|
||||
}
|
||||
|
||||
function tryFindSketch () {
|
||||
var sketch = Processing.instances[0];
|
||||
var sketch = Processing.getInstanceById(getProcessingSketchID());
|
||||
if ( sketch == undefined )
|
||||
return setTimeout(tryFindSketch, 200); // try again ..
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ window.onload = function () {
|
||||
}
|
||||
|
||||
function tryFindSketch () {
|
||||
var sketch = Processing.instances[0];
|
||||
var sketch = Processing.getInstanceById(getProcessingSketchID());
|
||||
if ( sketch == undefined ) return setTimeout(tryFindSketch, 200);
|
||||
|
||||
var controller = new Controller(sketch,"form-form");
|
||||
|
||||
@@ -13,14 +13,12 @@
|
||||
* <video width="480" height="360" style="display:none">
|
||||
* <source src="charmy.mp4" />
|
||||
* <source src="charmy.ogv" />
|
||||
* <source src="charmy.webm" />
|
||||
* </video>
|
||||
*/
|
||||
|
||||
Video video;
|
||||
PImage frame;
|
||||
float fSec = 1/25.0;
|
||||
int fMillis = int(1000 * fSec);
|
||||
int ts = 0;
|
||||
|
||||
void setup ()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user