Commit 4378bd94 authored by wildfirecode's avatar wildfirecode

1

parent 7d10232e
...@@ -119,10 +119,11 @@ export const doRecord = () => { ...@@ -119,10 +119,11 @@ export const doRecord = () => {
if (timer == -1) timer = Date.now(); if (timer == -1) timer = Date.now();
const secondsPassed = Math.floor((Date.now() - timer) / 1000); const secondsPassed = Math.floor((Date.now() - timer) / 1000);
const data = { const data = {
durationOfPlay: _songDuration * times + secondsPassed, durationOfPlay: secondsPassed,
// durationOfPlay: _songDuration * times + secondsPassed,
songListId: _songListId, songListId: _songListId,
songId: _songId, songId: _songId,
playCount: times, playCount: 1,
bitrate: _bitrate, bitrate: _bitrate,
songDuration: _songDuration songDuration: _songDuration
} }
...@@ -158,7 +159,7 @@ const sendDataOnLoopEnd = () => { ...@@ -158,7 +159,7 @@ const sendDataOnLoopEnd = () => {
const ms = date.getSeconds() >= 10 ? date.getSeconds() : '0' + date.getSeconds(); const ms = date.getSeconds() >= 10 ? date.getSeconds() : '0' + date.getSeconds();
const startdate = `${y}-${m}-${d} ${h}:${min}:${ms}`; const startdate = `${y}-${m}-${d} ${h}:${min}:${ms}`;
const durationOfPlay = _songDuration * times; const durationOfPlay = _songDuration;
const songListId = _songListId; const songListId = _songListId;
const songId = _songId;; const songId = _songId;;
const playCount = times; const playCount = times;
...@@ -170,12 +171,9 @@ const sendDataOnLoopEnd = () => { ...@@ -170,12 +171,9 @@ const sendDataOnLoopEnd = () => {
}; };
const getBitrate = (url: string) => { const getBitrate = (url: string) => { return 'MP3-128k-FTD';}
return 'MP3-128k-FTD';
}
let _ele; let _ele;
let subitemtype;
// export const setSongDuration = () => { // export const setSongDuration = () => {
// _songDuration = Math.floor(_ele.duration); // _songDuration = Math.floor(_ele.duration);
// } // }
...@@ -184,7 +182,6 @@ export default () => { ...@@ -184,7 +182,6 @@ export default () => {
NetManager.ins.getMusicCategory((success, result) => { NetManager.ins.getMusicCategory((success, result) => {
const songListId = _songListId = result.data.categoryID; const songListId = _songListId = result.data.categoryID;
const itemid = _songId = result.data.stationItems[0].itemID; const itemid = _songId = result.data.stationItems[0].itemID;
subitemtype = result.data.stationItems[0].itemType;
NetManager.ins.getMusicItem((success, result) => { NetManager.ins.getMusicItem((success, result) => {
const url = result.data.playURL; const url = result.data.playURL;
const ele = document.createElement('audio'); const ele = document.createElement('audio');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment