Skip to content
This repository has been archived by the owner on Dec 10, 2020. It is now read-only.

bind swf version to package.json version #75

Merged
merged 2 commits into from
Jan 30, 2014
Merged
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
6 changes: 5 additions & 1 deletion Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,8 @@ module.exports = function (grunt) {
var childProcess = require('child_process');
var flexSdk = require('flex-sdk');
var async = require('async');
console.log('mx');
var pkg = grunt.file.readJSON('package.json');

var
options = this.options,
done = this.async(),
Expand All @@ -207,9 +208,12 @@ module.exports = function (grunt) {
cmdLineOpts.push('-output');
cmdLineOpts.push(f.dest);
}

cmdLineOpts.push('-define=CONFIG::version, "' + pkg.version + '"');
cmdLineOpts.push('--');
cmdLineOpts.push.apply(cmdLineOpts, srcList);

grunt.verbose.writeln('package version: ' + pkg.version);
grunt.verbose.writeln('mxmlc path: ' + flexSdk.bin.mxmlc);
grunt.verbose.writeln('options: ' + JSON.stringify(cmdLineOpts));

Expand Down
Binary file modified dist/video-js.swf
Binary file not shown.
6 changes: 4 additions & 2 deletions src/VideoJS.as
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ package{

[SWF(backgroundColor="#000000", frameRate="60", width="480", height="270")]
public class VideoJS extends Sprite{

public const VERSION:String = CONFIG::version;

private var _app:VideoJSApp;
private var _stageSizeTimer:Timer;
Expand Down Expand Up @@ -53,8 +55,8 @@ package{
_app.model.stageRect = new Rectangle(0, 0, stage.stageWidth, stage.stageHeight);

// add content-menu version info
var _ctxVersion:ContextMenuItem = new ContextMenuItem("VideoJS Flash Component v4.0.0", false, false);
var _ctxAbout:ContextMenuItem = new ContextMenuItem("Copyright © 2013 Brightcove, Inc.", false, false);
var _ctxVersion:ContextMenuItem = new ContextMenuItem("VideoJS Flash Component v" + VERSION, false, false);
var _ctxAbout:ContextMenuItem = new ContextMenuItem("Copyright © 2014 Brightcove, Inc.", false, false);
var _ctxMenu:ContextMenu = new ContextMenu();
_ctxMenu.hideBuiltInItems();
_ctxMenu.customItems.push(_ctxVersion, _ctxAbout);
Expand Down