Permalink
Browse files

Remove balance of code from FLA, update build

The FlashMediaElement.fla file now matches the DisplayList structure
reference in FlashMediaElement.as.  Now there is no source code (only
assets) in FlashMediaElement.fla allowing you to update flashls.swc and
build with grunt (or any other AS3 code).

Added a more Flash standard conditional build for the CDN build.
  • Loading branch information...
1 parent 3837468 commit 89502def4d0ecf04f62c595f591e1a374f9caf4c @stevemayhew stevemayhew committed Apr 24, 2015
View
@@ -7,4 +7,7 @@
*.png binary
*.webm binary
*.swf binary
-*.xap binary
+*.swc binary
+*.fla binary
+*.xap binary
+
View
@@ -9,20 +9,6 @@ module.exports = function(grunt) {
grunt.loadNpmTasks('grunt-text-replace');
grunt.loadNpmTasks("grunt-remove-logging");
- var featureSources;
-
- // if commandline list of features, (e.g. --features=playpause,stop,...) build only these included
- var featureList = grunt.option('features');
- if (featureList) {
- featureList = featureList.split(',');
- featureSources = [];
- featureList.forEach(function(feature) {
- var path = 'src/js/mep-feature-' + feature + '.js';
- if (grunt.file.isFile(path)) {
- featureSources.push(path);
- }
- })
- }
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
concat: {
@@ -46,20 +32,18 @@ module.exports = function(grunt) {
src: [
'src/js/mep-header.js',
'src/js/mep-library.js',
- 'src/js/mep-player.js'
- ].concat([
- 'src/js/mep-feature-playpause.js',
- 'src/js/mep-feature-stop.js',
- 'src/js/mep-feature-progress.js',
- 'src/js/mep-feature-time.js',
- 'src/js/mep-feature-volume.js',
- 'src/js/mep-feature-fullscreen.js',
- 'src/js/mep-feature-speed.js',
- 'src/js/mep-feature-tracks.js',
- 'src/js/mep-feature-contextmenu.js',
- 'src/js/mep-feature-skipback.js',
- 'src/js/mep-feature-postroll.js'
- ] || featureSources),
+ 'src/js/mep-player.js',
+ 'src/js/mep-feature-playpause.js',
+ 'src/js/mep-feature-stop.js',
+ 'src/js/mep-feature-progress.js',
+ 'src/js/mep-feature-time.js',
+ 'src/js/mep-feature-volume.js',
+ 'src/js/mep-feature-fullscreen.js',
+ 'src/js/mep-feature-speed.js',
+ 'src/js/mep-feature-tracks.js',
+ 'src/js/mep-feature-contextmenu.js',
+ 'src/js/mep-feature-postroll.js'
+ ],
dest: 'local-build/mediaelementplayer.js'
},
bundle: {
@@ -119,19 +103,6 @@ module.exports = function(grunt) {
filter : 'isFile'
}
},
- replace: {
- cdnBuild: {
- src: ['src/flash/FlashMediaElement.as'],
- dest: 'tmp/FlashMediaElement.as',
- replacements: [{
- from: '//Security.allowDomain("*");',
- to: 'Security.allowDomain("*");'
- }, {
- from: '//Security.allowInsecureDomain("*");',
- to: 'Security.allowInsecureDomain("*");'
- }]
- }
- },
clean: {
build: ['local-build'],
temp: ['tmp']
@@ -164,7 +135,8 @@ module.exports = function(grunt) {
flexPath: '../flex_sdk_4.6',
buildFlashCommand: [
'<%= flexPath %>/bin/mxmlc -strict=false -compiler.debug -warnings=true',
- '<%= flashIn %> -o <%= flashOut %>',
+ 'src/flash/FlashMediaElement.as -o <%= flashOut %>',
+ '-define+=CONFIG::cdnBuild,<%= cdnBuild %>',
'-library-path+="<%= flexPath %>/lib"',
'-include-libraries+=src/flash/flashmediaelement.swc',
'-include-libraries+=src/flash/flashls.swc -use-network=true',
@@ -176,22 +148,22 @@ module.exports = function(grunt) {
shell: {
buildFlash: {
command: function() {
- grunt.config.set("flashIn", 'src/flash/FlashMediaElement.as');
+ grunt.config.set("cdnBuild", 'false');
grunt.config.set("flashOut", 'local-build/flashmediaelement.swf');
return grunt.config.get("buildFlashCommand");
}
},
buildFlashCDN: {
command: function() {
- grunt.config.set("flashIn", 'tmp/FlashMediaElement.as');
+ grunt.config.set("cdnBuild", 'true');
grunt.config.set("flashOut", 'local-build/flashmediaelement-cdn.swf');
return grunt.config.get("buildFlashCommand");
}
}
}
});
-
+
grunt.registerTask('default', ['concat', 'removelogging', 'uglify', 'cssmin', 'copy',
- 'shell:buildFlash', 'replace:cdnBuild', 'shell:buildFlashCDN', 'clean:temp']);
+ 'shell:buildFlash', 'shell:buildFlashCDN', 'clean:temp']);
-};
+};
@@ -52,7 +52,7 @@ package
private var _nativeVideoHeight:Number = 0;
// visual elements
- private var _mediaElementDisplay:FlashMediaElementDisplay = new FlashMediaElementDisplay();
+ private var _mediaElementDisplay:FlashMediaElementDisplay = new FlashMediaElementDisplay();
private var _output:TextField;
private var _fullscreenButton:SimpleButton;
@@ -103,8 +103,11 @@ package
checkFlashVars(loaderInfo.parameters);
// allows this player to be called from a different domain than the HTML page hosting the player
- //Security.allowDomain("*");
- //Security.allowInsecureDomain('*');
+ CONFIG::cdnBuild {
+ Security.allowDomain("*");
+ Security.allowInsecureDomain('*');
+ }
+
// add debug output
@@ -921,6 +924,7 @@ package
private function repositionVideo():void {
+ var fullscreen:Boolean;
if (stage.displayState == "fullScreen") {
fullscreen = true;
Binary file not shown.
Binary file not shown.

0 comments on commit 89502de

Please sign in to comment.