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

Video #143

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Video #143

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion lime/demos/tests/run.htm
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@
'scroll',
'stroke',
'tiled1', 'tiled2', 'tiled3',
'transitions1'
'transitions1',
'video',
'video2'
].sort();

for(var i=0;i<_allDemos.length;i++){
Expand Down
67 changes: 67 additions & 0 deletions lime/demos/tests/video.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
goog.provide('test.video');


goog.require('lime');
goog.require('lime.Video');

goog.require('lime.Director');
goog.require('lime.Label');

goog.require('lime.Layer');
goog.require('lime.Scene');

goog.require('lime.Sprite');
goog.require('lime.Circle');

goog.require('lime.animation.ScaleTo');
goog.require('lime.animation.MoveTo');
goog.require('lime.animation.Loop');


test.WIDTH = 600;
test.HEIGHT = 400;


test.start = function() {

//director
test.director = new lime.Director(document.body, test.WIDTH, test.HEIGHT);
test.director.makeMobileWebAppCapable();


var videoscene = new lime.Scene;

var layer = (new lime.Layer).setSize(test.WIDTH, test.HEIGHT).setPosition(0, 0);
videoscene.appendChild(layer);

var video = new lime.Video().setSize(320, 240).setAnchorPoint(0,0).setVideoUrl('http://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4');

//layer.appendChild(video);


var sprite = new lime.Sprite();

sprite.appendChild(video);

var ch1 = new lime.Circle().setSize(30, 30).setPosition(100, 100).setFill('#c00');
sprite.appendChild(ch1);

var ch2 = new lime.Circle().setSize(30, 30).setPosition(150, 100).setFill('#c00');
sprite.appendChild(ch2);

var ch3 = new lime.Circle().setSize(30, 30).setPosition(200, 100).setFill('#c00');
sprite.appendChild(ch3);

layer.appendChild(sprite);

goog.events.listen(video, ['VideoCanPlay', 'VideoCanPlayThrough'], function () {
video.playVideo();
}, false, this);

// set active scene
test.director.replaceScene(videoscene);


};

goog.exportSymbol('test.start', test.start);
67 changes: 67 additions & 0 deletions lime/demos/tests/video2.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
goog.provide('test.video2');


goog.require('lime');
goog.require('lime.Video');

goog.require('lime.Director');
goog.require('lime.Label');

goog.require('lime.Layer');
goog.require('lime.Scene');

goog.require('lime.Sprite');
goog.require('lime.Circle');

goog.require('lime.animation.ScaleTo');
goog.require('lime.animation.MoveTo');
goog.require('lime.animation.Loop');


test.WIDTH = 600;
test.HEIGHT = 400;


test.start = function() {

//director
test.director = new lime.Director(document.body, test.WIDTH, test.HEIGHT);
test.director.makeMobileWebAppCapable();


var videoscene = new lime.Scene;

var layer = (new lime.Layer).setSize(test.WIDTH, test.HEIGHT).setPosition(0, 0).setRenderer(lime.Renderer.CANVAS);
videoscene.appendChild(layer);

var video = new lime.Video().setSize(320, 240).setAnchorPoint(0,0).setPosition(0,0).setVideoUrl('http://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4');

layer.appendChild(video);


var sprite = new lime.Sprite().setRenderer(lime.Renderer.CANVAS);

sprite.appendChild(video);

var ch1 = new lime.Circle().setSize(30, 30).setPosition(0, 160).setFill('#c00');
sprite.appendChild(ch1);

var ch2 = new lime.Circle().setSize(30, 30).setPosition(150, 100).setFill('#c00');
sprite.appendChild(ch2);

var ch3 = new lime.Circle().setSize(30, 30).setPosition(200, 100).setFill('#c00');
sprite.appendChild(ch3);

layer.appendChild(sprite);

goog.events.listen(video, ['VideoCanPlay', 'VideoCanPlayThrough'], function () {
video.playVideo();
}, false, this);

// set active scene
test.director.replaceScene(videoscene);


};

goog.exportSymbol('test.start', test.start);
Loading