Skip to content

Commit

Permalink
Version bump to 0.9.1.
Browse files Browse the repository at this point in the history
  • Loading branch information
hustKiwi committed Jun 21, 2014
1 parent a8d11d4 commit 5684596
Show file tree
Hide file tree
Showing 7 changed files with 72 additions and 59 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "muplayer",
"version": "0.9.0",
"version": "0.9.1",
"authors": [
"https://github.com/Baidu-Music-FE"
],
Expand Down
Binary file modified dist/muplayer_mp3.swf
Binary file not shown.
Binary file modified dist/muplayer_mp4.swf
Binary file not shown.
73 changes: 38 additions & 35 deletions dist/player.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// @license
// Baidu Music Player: 0.9.0
// Baidu Music Player: 0.9.1
// -------------------------
// (c) 2014 FE Team of Baidu Music
// Can be freely distributed under the BSD license.
Expand Down Expand Up @@ -644,7 +644,8 @@ var __indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length;

EngineCore.prototype.reset = function() {
this.stop();
return this.setUrl();
this.setUrl();
return this.setState(STATES.NOT_INIT);
};

EngineCore.prototype.play = function() {
Expand Down Expand Up @@ -944,7 +945,7 @@ var __hasProp = {}.hasOwnProperty,
AudioCore = (function(_super) {
__extends(AudioCore, _super);

AudioCore.prototype.defaults = {
AudioCore.defaults = {
confidence: 'maybe',
preload: false,
autoplay: false,
Expand All @@ -957,7 +958,7 @@ var __hasProp = {}.hasOwnProperty,

function AudioCore(options) {
var audio, k, least, levels, opts, playEmpty, v;
this.opts = $.extend({}, this.defaults, options);
this.opts = $.extend({}, AudioCore.defaults, options);
this.opts.emptyMP3 = this.opts.baseDir + this.opts.emptyMP3;
opts = this.opts;
levels = {
Expand Down Expand Up @@ -994,6 +995,7 @@ var __hasProp = {}.hasOwnProperty,
})(this);
this.audio = audio;
this._needCanPlay(['play', 'setCurrentPosition']);
this.setState(STATES.NOT_INIT);
this._initEvents();
playEmpty = (function(_this) {
return function() {
Expand All @@ -1005,7 +1007,7 @@ var __hasProp = {}.hasOwnProperty,
}

AudioCore.prototype._test = function(trigger) {
if (Modernizr.audio === false || this._supportedTypes.length === 0) {
if (!Modernizr.audio || !this._supportedTypes.length) {
return false;
}
trigger && this.trigger(EVENTS.INIT_FAIL, this.engineType);
Expand Down Expand Up @@ -1132,15 +1134,11 @@ var __hasProp = {}.hasOwnProperty,
};

AudioCore.prototype.setVolume = function(volume) {
if (!((0 <= volume && volume <= 100))) {
this;
}
this.audio.volume = volume / 100;
return AudioCore.__super__.setVolume.call(this, volume);
};

AudioCore.prototype.setMute = function(mute) {
mute = !!mute;
this.audio.muted = mute;
return AudioCore.__super__.setMute.call(this, mute);
};
Expand Down Expand Up @@ -1614,9 +1612,12 @@ var __hasProp = {}.hasOwnProperty,
FlashCore = (function(_super) {
__extends(FlashCore, _super);

FlashCore.defaults = {
expressInstaller: 'expressInstall.swf'
};

function FlashCore(options) {
var baseDir, id, instanceName, opts;
this.defaults.expressInstaller = 'expressInstall.swf';
this.opts = opts = $.extend({}, this.defaults, options);
this._state = STATES.NOT_INIT;
this._loaded = false;
Expand Down Expand Up @@ -1651,7 +1652,7 @@ var __hasProp = {}.hasOwnProperty,
if (!$.flash.hasVersion(opts.flashVer)) {
return false;
}
trigger && this.trigger(EVENTS.INITFAIL, this.engineType);
trigger && this.trigger(EVENTS.INIT_FAIL, this.engineType);
return true;
};

Expand Down Expand Up @@ -1769,29 +1770,23 @@ var __hasProp = {}.hasOwnProperty,
return _results;
};

FlashCore.prototype.reset = function() {
FlashCore.__super__.reset.call(this);
this.setMute(this.getMute());
return this.setVolume(this.getVolume());
};

FlashCore.prototype.play = function() {
this.flash.play();
this.flash.f_play();
return this;
};

FlashCore.prototype.pause = function() {
this.flash.pause();
this.flash.f_pause();
return this;
};

FlashCore.prototype.stop = function() {
this.flash.stop();
this.flash.f_stop();
return this;
};

FlashCore.prototype._setUrl = function(url) {
return this.flash.load(url);
return this.flash.f_load(url);
};

FlashCore.prototype.setUrl = function(url) {
Expand Down Expand Up @@ -1830,9 +1825,6 @@ var __hasProp = {}.hasOwnProperty,
};

FlashCore.prototype.setVolume = function(volume) {
if (!((0 <= volume && volume <= 100))) {
this;
}
this._setVolume(volume);
return FlashCore.__super__.setVolume.call(this, volume);
};
Expand All @@ -1842,13 +1834,12 @@ var __hasProp = {}.hasOwnProperty,
};

FlashCore.prototype.setMute = function(mute) {
mute = !!mute;
this._setMute(mute);
return FlashCore.__super__.setMute.call(this, mute);
};

FlashCore.prototype.setCurrentPosition = function(ms) {
this.flash.play(ms);
this.flash.f_play(ms);
return this;
};

Expand Down Expand Up @@ -2155,18 +2146,27 @@ var __hasProp = {}.hasOwnProperty,

Engine.prototype.pause = function() {
this.curEngine.pause();
this.setState(STATES.PAUSE);
return this;
};

Engine.prototype.stop = function() {
this.curEngine.stop();
this.setState(STATES.STOP);
return this;
};

Engine.prototype.setState = function(st) {
this.curEngine.setState(st);
return this;
};

Engine.prototype.getState = function() {
return this.curEngine.getState();
};

Engine.prototype.setMute = function(mute) {
if (utils.isBoolean(mute)) {
this.curEngine.setMute(mute);
}
this.curEngine.setMute(!!mute);
return this;
};

Expand Down Expand Up @@ -2241,7 +2241,7 @@ var __hasProp = {}.hasOwnProperty,

instance = null;

Player.prototype.defaults = {
Player.defaults = {
baseDir: "http://mu7.bdstatic.com/cms/app/muplayer/" + (cfg.version.replace(/\./g, '_')) + "/",
mode: 'loop',
mute: false,
Expand Down Expand Up @@ -2306,7 +2306,7 @@ var __hasProp = {}.hasOwnProperty,

function Player(options) {
var baseDir, opts;
this.opts = opts = $.extend({}, this.defaults, options);
this.opts = opts = $.extend({}, Player.defaults, options);
baseDir = opts.baseDir;
if (baseDir === false) {
baseDir = '';
Expand Down Expand Up @@ -2382,7 +2382,7 @@ var __hasProp = {}.hasOwnProperty,
return def.resolve();
};
})(this);
if ((_ref1 = this.getState()) === STATES.NOT_INIT || _ref1 === STATES.STOP) {
if ((_ref1 = this.getState()) === STATES.NOT_INIT || _ref1 === STATES.STOP || _ref1 === STATES.END) {
this._fetch().done((function(_this) {
return function() {
return play();
Expand Down Expand Up @@ -2499,10 +2499,13 @@ var __hasProp = {}.hasOwnProperty,
Player.prototype.setCur = function(sid) {
var pl;
pl = this.playlist;
if (sid) {
if (!sid && this.getSongsNum()) {
sid = pl.list[0];
}
if (sid && this._sid !== sid) {
pl.setCur(sid);
} else if (this.getSongsNum()) {
pl.setCur(pl.list[0]);
this._sid = sid;
this.stop();
}
return this;
};
Expand Down
6 changes: 3 additions & 3 deletions dist/player.min.js

Large diffs are not rendered by default.

46 changes: 28 additions & 18 deletions dist/zepto-player.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// @license
// Baidu Music Player: 0.9.0
// Baidu Music Player: 0.9.1
// -------------------------
// (c) 2014 FE Team of Baidu Music
// Can be freely distributed under the BSD license.
Expand Down Expand Up @@ -644,7 +644,8 @@ var __indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length;

EngineCore.prototype.reset = function() {
this.stop();
return this.setUrl();
this.setUrl();
return this.setState(STATES.NOT_INIT);
};

EngineCore.prototype.play = function() {
Expand Down Expand Up @@ -944,7 +945,7 @@ var __hasProp = {}.hasOwnProperty,
AudioCore = (function(_super) {
__extends(AudioCore, _super);

AudioCore.prototype.defaults = {
AudioCore.defaults = {
confidence: 'maybe',
preload: false,
autoplay: false,
Expand All @@ -957,7 +958,7 @@ var __hasProp = {}.hasOwnProperty,

function AudioCore(options) {
var audio, k, least, levels, opts, playEmpty, v;
this.opts = $.extend({}, this.defaults, options);
this.opts = $.extend({}, AudioCore.defaults, options);
this.opts.emptyMP3 = this.opts.baseDir + this.opts.emptyMP3;
opts = this.opts;
levels = {
Expand Down Expand Up @@ -994,6 +995,7 @@ var __hasProp = {}.hasOwnProperty,
})(this);
this.audio = audio;
this._needCanPlay(['play', 'setCurrentPosition']);
this.setState(STATES.NOT_INIT);
this._initEvents();
playEmpty = (function(_this) {
return function() {
Expand All @@ -1005,7 +1007,7 @@ var __hasProp = {}.hasOwnProperty,
}

AudioCore.prototype._test = function(trigger) {
if (Modernizr.audio === false || this._supportedTypes.length === 0) {
if (!Modernizr.audio || !this._supportedTypes.length) {
return false;
}
trigger && this.trigger(EVENTS.INIT_FAIL, this.engineType);
Expand Down Expand Up @@ -1132,15 +1134,11 @@ var __hasProp = {}.hasOwnProperty,
};

AudioCore.prototype.setVolume = function(volume) {
if (!((0 <= volume && volume <= 100))) {
this;
}
this.audio.volume = volume / 100;
return AudioCore.__super__.setVolume.call(this, volume);
};

AudioCore.prototype.setMute = function(mute) {
mute = !!mute;
this.audio.muted = mute;
return AudioCore.__super__.setMute.call(this, mute);
};
Expand Down Expand Up @@ -1371,18 +1369,27 @@ var __hasProp = {}.hasOwnProperty,

Engine.prototype.pause = function() {
this.curEngine.pause();
this.setState(STATES.PAUSE);
return this;
};

Engine.prototype.stop = function() {
this.curEngine.stop();
this.setState(STATES.STOP);
return this;
};

Engine.prototype.setState = function(st) {
this.curEngine.setState(st);
return this;
};

Engine.prototype.getState = function() {
return this.curEngine.getState();
};

Engine.prototype.setMute = function(mute) {
if (utils.isBoolean(mute)) {
this.curEngine.setMute(mute);
}
this.curEngine.setMute(!!mute);
return this;
};

Expand Down Expand Up @@ -1457,7 +1464,7 @@ var __hasProp = {}.hasOwnProperty,

instance = null;

Player.prototype.defaults = {
Player.defaults = {
baseDir: "http://mu7.bdstatic.com/cms/app/muplayer/" + (cfg.version.replace(/\./g, '_')) + "/",
mode: 'loop',
mute: false,
Expand Down Expand Up @@ -1522,7 +1529,7 @@ var __hasProp = {}.hasOwnProperty,

function Player(options) {
var baseDir, opts;
this.opts = opts = $.extend({}, this.defaults, options);
this.opts = opts = $.extend({}, Player.defaults, options);
baseDir = opts.baseDir;
if (baseDir === false) {
baseDir = '';
Expand Down Expand Up @@ -1598,7 +1605,7 @@ var __hasProp = {}.hasOwnProperty,
return def.resolve();
};
})(this);
if ((_ref1 = this.getState()) === STATES.NOT_INIT || _ref1 === STATES.STOP) {
if ((_ref1 = this.getState()) === STATES.NOT_INIT || _ref1 === STATES.STOP || _ref1 === STATES.END) {
this._fetch().done((function(_this) {
return function() {
return play();
Expand Down Expand Up @@ -1715,10 +1722,13 @@ var __hasProp = {}.hasOwnProperty,
Player.prototype.setCur = function(sid) {
var pl;
pl = this.playlist;
if (sid) {
if (!sid && this.getSongsNum()) {
sid = pl.list[0];
}
if (sid && this._sid !== sid) {
pl.setCur(sid);
} else if (this.getSongsNum()) {
pl.setCur(pl.list[0]);
this._sid = sid;
this.stop();
}
return this;
};
Expand Down
4 changes: 2 additions & 2 deletions dist/zepto-player.min.js

Large diffs are not rendered by default.

0 comments on commit 5684596

Please sign in to comment.