Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
db-game-template
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
崔立强
db-game-template
Commits
4378bd94
Commit
4378bd94
authored
Aug 09, 2019
by
wildfirecode
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
7d10232e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
8 deletions
+5
-8
getMusicUrl.ts
egret/src/getMusicUrl.ts
+5
-8
No files found.
egret/src/getMusicUrl.ts
View file @
4378bd94
...
@@ -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'
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment