{"size": 1772, "ext": "js", "max_stars_repo_path": "tests/tests/media.js", "max_stars_repo_name": "betajs/betajs-flash", "max_stars_repo_stars_event_min_datetime": "2016-01-11T10:12:21.000Z", "max_stars_repo_stars_event_max_datetime": "2016-01-11T10:12:21.000Z", "max_issues_repo_path": "tests/tests/media.js", "max_issues_repo_name": "betajs/betajs-flash", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "tests/tests/media.js", "max_forks_repo_name": "betajs/betajs-flash", "max_forks_repo_forks_event_min_datetime": "2018-11-15T09:45:53.000Z", "max_forks_repo_forks_event_max_datetime": "2018-12-03T03:05:30.000Z"}
{"max_stars_count": 1, "max_issues_count": null, "max_forks_count": 2, "avg_line_length": 40.2727272727, "max_line_length": 113, "alphanum_fraction": 0.6946952596}
QUnit.test("test playback mp4", function(assert) {
	var flashFile = window.BrowserStack ? "//betajs.com/betajs-flash.swf" : "../dist/betajs-flash.swf";
	var videoFile = window.BrowserStack ? "http://betajs.com/movie.mp4" : document.location + "/../tests/movie.mp4";
	var done = assert.async();
	var registry = new BetaJS.Flash.FlashClassRegistry();
	registry.register("flash.media.Video", ["attachNetStream"]);
	registry.register("flash.display.Sprite", ["addChild"]);
	registry.register("flash.net.NetStream", ["play", "addEventListener"]);
	registry.register("flash.net.NetConnection", ["connect", "addEventListener"]);
	var embedding = new BetaJS.Flash.FlashEmbedding(document.getElementById("visible-fixture"), {
		registry: registry,
		wrap: true
	}, {
		flashFile: flashFile,
		forceReload: true
	});
	embedding.ready(function () {
		var main = embedding.flashMain();
		var stage = main.get("stage");
		stage.set("scaleMode", "noScale");
		stage.set("align", "TL");
		var video = embedding.newObject("flash.media.Video", stage.get("stageWidth"), stage.get("stageHeight"));
		main.addChildVoid(video);
		var connection = embedding.newObject("flash.net.NetConnection");
		var cb = embedding.newCallback(function () {
			var stream = embedding.newObject("flash.net.NetStream", connection);
			stream.set("client", embedding.newCallback("onMetaData", function (info) {
                assert.equal(info.width, 640);
                assert.equal(info.height, 360);
				done();
				embedding.destroy();
			}));
			
			stream.addEventListener("netStatus", embedding.newCallback(function (event) {
			}));
			
			video.attachNetStreamVoid(stream);
			stream.playVoid(videoFile);
		});
		connection.addEventListener("netStatus", cb);
		connection.connectVoid(null);
	});
});
