提交 24806908 编写于 作者: fxy060608's avatar fxy060608

chore: build

上级 ef9f09db
......@@ -15003,7 +15003,7 @@ function createAudioInstance() {
audioId,
};
}
function setAudioState({ audioId, src, startTime, autoplay = false, loop = false, obeyMuteSwitch, volume, sessionCategory = AUDIO_DEFAULT_SESSION_CATEGORY, }) {
function setAudioState({ audioId, src, startTime, autoplay = false, loop = false, obeyMuteSwitch, volume, sessionCategory = AUDIO_DEFAULT_SESSION_CATEGORY, playbackRate, }) {
const audio = audios[audioId];
if (audio) {
const style = {
......@@ -15011,7 +15011,10 @@ function setAudioState({ audioId, src, startTime, autoplay = false, loop = false
autoplay,
};
if (src) {
audio.src = style.src = getRealPath(src);
// iOS 设置 src 会重新播放
const realSrc = getRealPath(src);
if (audio.src !== realSrc)
audio.src = style.src = realSrc;
}
if (startTime) {
audio.startTime = style.startTime = startTime;
......@@ -15023,6 +15026,10 @@ function setAudioState({ audioId, src, startTime, autoplay = false, loop = false
if (sessionCategory) {
audio.setSessionCategory(sessionCategory);
}
if (playbackRate && audio.playbackRate) {
// @ts-ignore
audio.playbackRate(playbackRate);
}
initStateChage(audioId);
}
return {
......@@ -15128,6 +15135,10 @@ const props$1 = [
{
name: 'volume',
},
{
name: 'playbackRate',
cache: true,
},
];
class InnerAudioContext {
constructor(id) {
......@@ -15378,7 +15389,7 @@ function getBackgroundAudioState() {
}
return data;
}
function setMusicState(args) {
function setMusicState(args, name) {
initMusic();
const props = [
'src',
......@@ -15389,6 +15400,11 @@ function setMusicState(args) {
'epname',
'title',
];
if (name === 'playbackRate') {
let val = args[name];
audio.playbackRate && audio.playbackRate(parseFloat(val));
return;
}
const style = {};
Object.keys(args).forEach((key) => {
if (props.indexOf(key) >= 0) {
......@@ -15501,6 +15517,11 @@ const props = [
readonly: true,
default: 'http',
},
{
name: 'playbackRate',
default: 1,
cache: true,
},
];
class BackgroundAudioManager {
constructor() {
......@@ -15516,7 +15537,7 @@ class BackgroundAudioManager {
? undefined
: (value) => {
this._options[name] = value;
setMusicState(this._options);
setMusicState(this._options, name);
},
});
});
......
......@@ -214,7 +214,7 @@ function setMusicState(args: Partial<Audio>, name?: string) {
'title',
]
if (name && name === 'playbackRate') {
if (name === 'playbackRate') {
let val = (args as any)[name]
audio.playbackRate && audio.playbackRate(parseFloat(val as string))
return
......
......@@ -17,6 +17,10 @@ function invokeCreateVueAppHook(app) {
createVueAppHooks.forEach((hook) => hook(app));
}
function getBaseSystemInfo() {
return wx.getSystemInfoSync()
}
const E = function () {
// Keep this empty so it's easier to inherit from
// (via https://github.com/lipsmack from https://github.com/scottcorgan/tiny-emitter/issues/3)
......@@ -68,10 +72,6 @@ E.prototype = {
};
var E$1 = E;
function getBaseSystemInfo() {
return wx.getSystemInfoSync()
}
function validateProtocolFail(name, msg) {
console.warn(`${name}: ${msg}`);
}
......@@ -994,18 +994,18 @@ function createSelectorQuery() {
}
var shims = /*#__PURE__*/Object.freeze({
__proto__: null,
getProvider: getProvider,
createSelectorQuery: createSelectorQuery
__proto__: null,
getProvider: getProvider,
createSelectorQuery: createSelectorQuery
});
var protocols = /*#__PURE__*/Object.freeze({
__proto__: null,
redirectTo: redirectTo,
previewImage: previewImage,
getSystemInfo: getSystemInfo,
getSystemInfoSync: getSystemInfoSync,
showActionSheet: showActionSheet
__proto__: null,
redirectTo: redirectTo,
previewImage: previewImage,
getSystemInfo: getSystemInfo,
getSystemInfoSync: getSystemInfoSync,
showActionSheet: showActionSheet
});
var index = initUni(shims, protocols);
......
......@@ -21,11 +21,13 @@ const ON_RESIZE = 'onResize';
const ON_TAB_ITEM_TAP = 'onTabItemTap';
const ON_REACH_BOTTOM = 'onReachBottom';
const ON_PULL_DOWN_REFRESH = 'onPullDownRefresh';
const ON_ADD_TO_FAVORITES = 'onAddToFavorites';
const ON_ADD_TO_FAVORITES = 'onAddToFavorites';
const customizeRE = /:/g;
function customizeEvent(str) {
return camelize(str.replace(customizeRE, '-'));
}
function hasLeadingSlash(str) {
return str.indexOf('/') === 0;
}
......@@ -48,7 +50,7 @@ function once(fn, ctx = null) {
}
return res;
});
}
}
const encode = encodeURIComponent;
function stringifyQuery(obj, encodeStr = encode) {
......@@ -68,7 +70,8 @@ function stringifyQuery(obj, encodeStr = encode) {
.join('&')
: null;
return res ? `?${res}` : '';
}
}
const MINI_PROGRAM_PAGE_RUNTIME_HOOKS = /*#__PURE__*/ (() => {
return {
onPageScroll: 1,
......@@ -859,12 +862,12 @@ function handleLink(event) {
}
var parseOptions = /*#__PURE__*/Object.freeze({
__proto__: null,
mocks: mocks,
isPage: isPage,
initRelation: initRelation,
handleLink: handleLink,
initLifetimes: initLifetimes
__proto__: null,
mocks: mocks,
isPage: isPage,
initRelation: initRelation,
handleLink: handleLink,
initLifetimes: initLifetimes
});
const createApp = initCreateApp();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册