Jump to content

Trouble with video in Phaser.io


jjwallace
 Share

Recommended Posts

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

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...