mirror of
https://github.com/cocos/cocos4.git
synced 2026-12-02 00:22:43 +08:00
f02a9851fa
Squashed commit of the following: commit 7afbfa6e02df7408b11873947157085598051395 Author: zilongshanren <guanghui8827@126.com> Date: Mon May 23 15:46:41 2016 +0800 minor tweak of the implementation commit ddb885ef505bc9c7ed88d6977f01add391fb78b2 Merge: 9cebe78a568ac9Author: zilongshanren <guanghui8827@126.com> Date: Mon May 23 15:13:53 2016 +0800 Merge branch 'master' into addVideoSupport commit 9cebe789fa811e97b5c79186e23e33c9998e28b4 Merge: 806825ef765762Author: zilongshanren <guanghui8827@126.com> Date: Mon May 23 14:55:55 2016 +0800 Merge branch 'master' into addVideoSupport commit 806825eced92003c6a06a31f202998a563cc09aa Author: zilongshanren <guanghui8827@126.com> Date: Mon May 23 14:51:59 2016 +0800 refactor video player component commit 381de09ccba26817cbf29159497a1a7b0f41f994 Author: zilongshanren <guanghui8827@126.com> Date: Fri May 20 16:51:50 2016 +0800 remove jsb-videoplayer.js commit 82a1ef74cb1b9940cd6ff180796dcb91b5853bce Author: zilongshanren <guanghui8827@126.com> Date: Fri May 20 16:48:20 2016 +0800 add tooptip for video player component commit 06a67ec425ca0713bee36d4189fb0b84e78bca57 Author: zilongshanren <guanghui8827@126.com> Date: Fri May 20 14:08:48 2016 +0800 ios videoplayer works commit 8e69bba2b692680737a940d926b1e4f7546a5a52 Author: zilongshanren <guanghui8827@126.com> Date: Thu May 19 17:56:56 2016 +0800 add jsb video commit e07fb5640cd5f4bae077923d11a2918cd8dc3b2e Merge: a6dc10a 21fc4f7 Author: zilongshanren <guanghui8827@126.com> Date: Wed May 18 18:12:56 2016 +0800 Merge branch 'master_video' of https://github.com/VisualSJ/engine-1 into addVideoSupport commit 21fc4f7f17dcb2277b9c69a49bb5d66e205209bd Author: ViusualSJ <itharbors@outlook.com> Date: Tue May 17 11:05:05 2016 +0800 Add video click (play/pause) commit 59040d4ea6165e1c53bb3c9d378dea696932b975 Merge: ad5b5e87976787Author: ViusualSJ <itharbors@outlook.com> Date: Tue May 17 10:46:20 2016 +0800 Merge branch 'master' of github.com:cocos-creator/engine into master_video commit ad5b5e8587d5fd673501a5cf8c990d3ca6385a9c Author: ViusualSJ <itharbors@outlook.com> Date: Tue May 17 10:37:02 2016 +0800 Fixed a bug about video transform commit 6b8e5ae2c3917ad182cf0e1bf922193ac66f17d0 Author: ViusualSJ <itharbors@outlook.com> Date: Mon May 16 16:38:13 2016 +0800 Fixed a bug about comp can't play commit a6dc10a314db915c12f7fd545da7d0f6f89281a9 Merge: 4e92fa8a298738Author: zilongshanren <guanghui8827@126.com> Date: Mon May 16 14:45:22 2016 +0800 Merge branch 'master' into addVideoSupport commit 4e92fa80f38544c14edce9a0a0424e4635829314 Author: ViusualSJ <itharbors@outlook.com> Date: Fri May 13 10:22:10 2016 +0800 create videoplayer.html commit cd0bd01df61deab6a285609f48593e478cfe44f0 Author: ViusualSJ <itharbors@outlook.com> Date: Thu May 12 15:40:59 2016 +0800 init video player
174 lines
6.4 KiB
JavaScript
174 lines
6.4 KiB
JavaScript
/****************************************************************************
|
|
Copyright (c) 2013-2016 Chukong Technologies Inc.
|
|
|
|
http://www.cocos.com
|
|
|
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
of this software and associated engine source code (the "Software"), a limited,
|
|
worldwide, royalty-free, non-assignable, revocable and non-exclusive license
|
|
to use Cocos Creator solely to develop games on your target platforms. You shall
|
|
not use Cocos Creator software for developing other software or tools that's
|
|
used for developing games. You are not granted to publish, distribute,
|
|
sublicense, and/or sell copies of Cocos Creator.
|
|
|
|
The software or tools in this License Agreement are licensed, not sold.
|
|
Chukong Aipu reserves all rights not expressly granted to you.
|
|
|
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
THE SOFTWARE.
|
|
****************************************************************************/
|
|
|
|
'use strict';
|
|
|
|
var Path = require('path');
|
|
var gulp = require('gulp');
|
|
var concat = require('gulp-concat');
|
|
var es = require('event-stream');
|
|
var sourcemaps = require('gulp-sourcemaps');
|
|
|
|
var srcs = [
|
|
|
|
'./cocos2d/core/base-nodes/BaseNodesPropertyDefine.js',
|
|
'./cocos2d/core/base-nodes/CCSGNode.js',
|
|
'./cocos2d/core/base-nodes/CCSGNodeCanvasRenderCmd.js',
|
|
'./cocos2d/core/base-nodes/CCSGNodeWebGLRenderCmd.js',
|
|
|
|
'./cocos2d/core/scenes/CCSGScene.js',
|
|
'./cocos2d/core/scenes/CCLoaderScene.js',
|
|
|
|
'./cocos2d/core/layers/CCLayer.js',
|
|
'./cocos2d/core/layers/CCLayerCanvasRenderCmd.js',
|
|
'./cocos2d/core/layers/CCLayerWebGLRenderCmd.js',
|
|
|
|
'./cocos2d/core/sprites/SpritesPropertyDefine.js',
|
|
'./cocos2d/core/sprites/CCSGSprite.js',
|
|
'./cocos2d/core/sprites/CCSGSpriteCanvasRenderCmd.js',
|
|
'./cocos2d/core/sprites/CCSGSpriteWebGLRenderCmd.js',
|
|
'./cocos2d/core/sprites/CCBakeSprite.js',
|
|
'./cocos2d/core/sprites/CCSpriteBatchNode.js',
|
|
'./cocos2d/core/sprites/CCSpriteBatchNodeCanvasRenderCmd.js',
|
|
'./cocos2d/core/sprites/CCSpriteBatchNodeWebGLRenderCmd.js',
|
|
|
|
'./cocos2d/core/sprites/CCScale9Sprite.js',
|
|
'./cocos2d/core/sprites/CCScale9SpriteCanvasRenderCmd.js',
|
|
'./cocos2d/core/sprites/CCScale9SpriteWebGLRenderCmd.js',
|
|
|
|
'./cocos2d/core/CCConfiguration.js',
|
|
|
|
'./cocos2d/core/CCDrawingPrimitivesCanvas.js',
|
|
'./cocos2d/core/CCDrawingPrimitivesWebGL.js',
|
|
|
|
'./cocos2d/core/label/CCSGLabel.js',
|
|
'./cocos2d/core/label/CCSGLabelCanvasRenderCmd.js',
|
|
'./cocos2d/core/label/CCSGLabelWebGLRenderCmd.js',
|
|
|
|
'./cocos2d/core/editbox/CCSGEditBox.js',
|
|
'./cocos2d/core/editBox/CCdomNode.js',
|
|
|
|
'./cocos2d/core/videoplayer/CCSGVideoPlayer.js',
|
|
|
|
'./cocos2d/render-texture/CCRenderTexture.js',
|
|
'./cocos2d/render-texture/CCRenderTextureCanvasRenderCmd.js',
|
|
'./cocos2d/render-texture/CCRenderTextureWebGLRenderCmd.js',
|
|
|
|
'./cocos2d/shape-nodes/CCDrawNode.js',
|
|
'./cocos2d/shape-nodes/CCDrawNodeCanvasRenderCmd.js',
|
|
'./cocos2d/shape-nodes/CCDrawNodeWebGLRenderCmd.js',
|
|
|
|
'./cocos2d/clipping-nodes/CCClippingNode.js',
|
|
'./cocos2d/clipping-nodes/CCClippingNodeCanvasRenderCmd.js',
|
|
'./cocos2d/clipping-nodes/CCClippingNodeWebGLRenderCmd.js',
|
|
|
|
'./cocos2d/particle/CCSGParticleSystem.js',
|
|
'./cocos2d/particle/CCSGParticleSystemCanvasRenderCmd.js',
|
|
'./cocos2d/particle/CCSGParticleSystemWebGLRenderCmd.js',
|
|
// './cocos2d/particle/CCSGParticleExamples.js',
|
|
'./cocos2d/particle/CCParticleBatchNode.js',
|
|
'./cocos2d/particle/CCParticleBatchNodeCanvasRenderCmd.js',
|
|
'./cocos2d/particle/CCParticleBatchNodeWebGLRenderCmd.js',
|
|
|
|
'./cocos2d/tilemap/CCSGTMXTiledMap.js',
|
|
'./cocos2d/tilemap/CCTMXXMLParser.js',
|
|
'./cocos2d/tilemap/CCTMXObjectGroup.js',
|
|
'./cocos2d/tilemap/CCSGTMXLayer.js',
|
|
'./cocos2d/tilemap/CCTMXLayerCanvasRenderCmd.js',
|
|
'./cocos2d/tilemap/CCTMXLayerWebGLRenderCmd.js',
|
|
|
|
'./cocos2d/parallax/CCParallaxNode.js',
|
|
'./cocos2d/parallax/CCParallaxNodeRenderCmd.js',
|
|
|
|
'./cocos2d/physics/CCPhysicsDebugNode.js',
|
|
'./cocos2d/physics/CCPhysicsDebugNodeCanvasRenderCmd.js',
|
|
'./cocos2d/physics/CCPhysicsDebugNodeWebGLRenderCmd.js',
|
|
|
|
'./cocos2d/motion-streak/CCSGMotionStreak.js',
|
|
'./cocos2d/motion-streak/CCSGMotionStreakWebGLRenderCmd.js'
|
|
|
|
];
|
|
|
|
var header = new Buffer('(function (cc, ccui, ccs, cp) {\n');
|
|
var footer = new Buffer('\n}).call(window, cc, ccui, ccs, cp);\n');
|
|
|
|
//function wrap (header, footer) {
|
|
// return es.through(function (file) {
|
|
// file.contents = Buffer.concat([header, file.contents, footer]);
|
|
// this.emit('data', file);
|
|
// });
|
|
//}
|
|
|
|
var File = require('vinyl');
|
|
function wrapFile (header, footer) {
|
|
var headerFile = new File({
|
|
cwd: process.cwd(),
|
|
base: process.cwd(),
|
|
path: Path.resolve('header.js'),
|
|
contents: header
|
|
});
|
|
var footerFile = new File({
|
|
cwd: process.cwd(),
|
|
base: process.cwd(),
|
|
path: Path.resolve('footer.js'),
|
|
contents: footer
|
|
});
|
|
var isHeaderInserted = false;
|
|
return es.through(
|
|
function (file) {
|
|
if (!isHeaderInserted) {
|
|
this.emit('data', headerFile);
|
|
isHeaderInserted = true;
|
|
}
|
|
//file.contents = Buffer.concat([header, file.contents, footer]);
|
|
this.emit('data', file);
|
|
},
|
|
function () {
|
|
this.emit('data', footerFile);
|
|
this.emit('end');
|
|
}
|
|
);
|
|
}
|
|
|
|
gulp.task('build-modular-cocos2d', function () {
|
|
return gulp.src(srcs)
|
|
.pipe(wrapFile(header, footer))
|
|
.pipe(sourcemaps.init())
|
|
.pipe(concat(Path.basename(paths.modularCocos2d)))
|
|
.pipe(sourcemaps.write('./'))
|
|
//.pipe(wrap(header, footer))
|
|
|
|
.pipe(es.through(
|
|
function (file) {
|
|
var content = file.contents.toString();
|
|
content = content.replace(/\r\n/g , '\n');
|
|
file.contents = new Buffer(content);
|
|
this.emit('data', file);
|
|
}
|
|
))
|
|
|
|
.pipe(gulp.dest(Path.dirname(paths.modularCocos2d)));
|
|
});
|