jjwallace Posted August 19, 2015 Share Posted August 19, 2015 Hello i am trying to make a small application for video in html5. I would like to load a video but i am doing something horribly wrong. I am using the hello world for phaser. I have tried both Phaser.js and phaser.min.js Neither one seems to work with video. MY CODE IS BELOW<!doctype html><html> <head> <meta charset="UTF-8" /> <title>hello phaser!</title> <script src="Phaser.js"></script> </head> <body> <script type="text/javascript"> window.onload = function (){ var game = new Phaser.Game(720, 480, Phaser.AUTO, '', { preload: preload, create: create }); function preload () { game.load.image('logo', 'phaser.png'); game.load.video('myvideo1', 'video1.mp4'); } function create () { var logo = game.add.sprite(game.world.centerX, game.world.centerY, 'logo'); logo.anchor.setTo(0.5, 0.5); video = game.add.video('myvideo1'); video.onPlay.addOnce(start, this); sprite = video.addToWorld(400, 300, 0.5, 0.5); video.play(); } }; </script> </body></html> Link to comment Share on other sites More sharing options...
rich Posted August 19, 2015 Share Posted August 19, 2015 What actually happens? (and are you definitely using Phaser 2.4.x?) Link to comment Share on other sites More sharing options...
Recommended Posts