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

Commit

Permalink
Merge pull request #75 from videojs/feature/version-bind
Browse files Browse the repository at this point in the history
bind swf version to package.json version
  • Loading branch information
tomjohnson916 committed Jan 30, 2014
2 parents 992164a + be4647d commit 7622432
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
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

0 comments on commit 7622432

Please sign in to comment.