|
@@ -4,7 +4,8 @@ import {
|
|
|
onUnmounted,
|
|
|
reactive,
|
|
|
ref,
|
|
|
- watch
|
|
|
+ watch,
|
|
|
+ nextTick
|
|
|
} from 'vue';
|
|
|
// import WaveSurfer from 'wavesurfer.js';
|
|
|
// import Regions from 'wavesurfer.js/dist/plugins/regions.js';
|
|
@@ -24,7 +25,7 @@ import videoLabel from './share-model/images/videoLabel.png';
|
|
|
import musicBg from './share-model/images/music-bg.png';
|
|
|
import playImg from './images/play.png';
|
|
|
import { browser, getGradeCh, getSecondRPM, vaildMusicScoreUrl } from '@/helpers/utils';
|
|
|
-import { onBeforeRouteUpdate, useRoute, useRouter } from 'vue-router';
|
|
|
+import { onBeforeRouteUpdate, useRoute, useRouter, onBeforeRouteLeave } from 'vue-router';
|
|
|
import {
|
|
|
api_openUserMusicDetail,
|
|
|
api_openUserMusicPage,
|
|
@@ -32,7 +33,6 @@ import {
|
|
|
api_verification
|
|
|
} from './api';
|
|
|
import MEmpty from '@/components/m-empty';
|
|
|
-import { nextTick } from 'process';
|
|
|
import MVideo from '@/components/m-video';
|
|
|
import LoginModel from './login-model';
|
|
|
import { removeAuth } from '../student-register/layout/utils';
|
|
@@ -52,6 +52,7 @@ import audioBga1 from "./images/leftCloud.json";
|
|
|
import audioBga2 from "./images/rightCloud.json";
|
|
|
import videobg from "./images/videobg.png";
|
|
|
import audioVisualDraw from "./audioVisualDraw"
|
|
|
+import playProgressData from "./playCreation/playProgress"
|
|
|
|
|
|
export default defineComponent({
|
|
|
name: 'creation-detail',
|
|
@@ -163,6 +164,8 @@ export default defineComponent({
|
|
|
};
|
|
|
|
|
|
const onDetail = (item: any) => {
|
|
|
+ playProgressData.playProgress = 0
|
|
|
+ playProgressData.playState = false
|
|
|
router.push({
|
|
|
path: '/shareCreation',
|
|
|
query: {
|
|
@@ -181,6 +184,8 @@ export default defineComponent({
|
|
|
// 在微信中运行的时候,微信没有开放自动加载资源的权限,所以要等播放之后才显示播放控制器
|
|
|
player.on('loadedmetadata', () => {
|
|
|
plyrState.loaded = true
|
|
|
+ player.currentTime = playProgressData.playProgress
|
|
|
+ if(playProgressData.playState) handlerClickPlay()
|
|
|
});
|
|
|
player.on("timeupdate", ()=>{
|
|
|
plyrState.currentTime = player.currentTime
|
|
@@ -243,6 +248,8 @@ export default defineComponent({
|
|
|
}
|
|
|
function handlerLandscapeScreen(event:any){
|
|
|
event.stopPropagation()
|
|
|
+ playProgressData.playState = !!state._plrl?.playing
|
|
|
+ playProgressData.playProgress = state._plrl?.currentTime || 0
|
|
|
router.push({
|
|
|
path:"/playCreation",
|
|
|
query:{
|
|
@@ -441,6 +448,13 @@ export default defineComponent({
|
|
|
staffState.height = "initial"
|
|
|
__init();
|
|
|
});
|
|
|
+ onBeforeRouteLeave((to, from, next)=>{
|
|
|
+ if(to.path !== "/playCreation"){
|
|
|
+ playProgressData.playProgress = 0
|
|
|
+ playProgressData.playState = false
|
|
|
+ }
|
|
|
+ next()
|
|
|
+ })
|
|
|
return () => (
|
|
|
<div
|
|
|
style={
|