captain-ui
Version:
有赞vue wap业务组件库
78 lines (70 loc) • 1.52 kB
JavaScript
;
exports.__esModule = true;
exports.default = void 0;
var _default = {
props: {
audioEventBus: Object,
percentage: Number,
formatedCurrentTime: String,
formatedDuration: String,
loadedPercentage: Number,
loadedStartPercentage: Number,
isStop: Boolean,
isPlaying: Boolean,
isPause: Boolean,
isLoading: Boolean,
isLoaded: Boolean
},
methods: {
/**
* 播放音频
*/
play: function play() {
this.audioEventBus.$emit('audio:play');
},
/**
* 暂停音频
*/
pause: function pause() {
this.audioEventBus.$emit('audio:pause');
},
/**
* 停止播放
*/
stop: function stop() {
this.audioEventBus.$emit('audio:stop');
},
/**
* 快进
*/
forward: function forward() {
this.audioEventBus.$emit('audio:forward');
},
/**
* 快退
*/
back: function back() {
this.audioEventBus.$emit('audio:back');
},
/**
* 重播音频
*/
replay: function replay() {
this.audioEventBus.$emit('audio:replay');
},
/**
* 重置音频
*/
resetAudio: function resetAudio() {
this.audioEventBus.$emit('audio:reset');
},
/**
* 播放进度跳转
* @param {number} percentage 播放进度百分比
*/
updateProgress: function updateProgress(percentage) {
this.audioEventBus.$emit('audio:progress:update', percentage);
}
}
};
exports.default = _default;