Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
J
jensen
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
Skye Yu
jensen
Commits
0d599743
Commit
0d599743
authored
Oct 09, 2024
by
Skye Yu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add file download finish log
parent
5c9092bc
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
+4
-2
jensen.js
src/jensen.js
+4
-2
No files found.
src/jensen.js
View file @
0d599743
import
{
Logger
as
internalLogger
}
from
'./utils/utils'
;
import
{
Logger
,
Logger
as
internalLogger
}
from
'./utils/utils'
;
const
QUERY_DEVICE_INFO
=
0x01
;
const
QUERY_DEVICE_INFO
=
0x01
;
const
QUERY_DEVICE_TIME
=
0x02
;
const
QUERY_DEVICE_TIME
=
0x02
;
...
@@ -723,7 +723,7 @@ Jensen.prototype.getFile = async function (filename, length, ondata, onprogress)
...
@@ -723,7 +723,7 @@ Jensen.prototype.getFile = async function (filename, length, ondata, onprogress)
function
removeAudio
()
{
function
removeAudio
()
{
const
audio
=
document
.
getElementById
(
'test_audio'
);
const
audio
=
document
.
getElementById
(
'test_audio'
);
audio
&&
audio
.
remove
();
audio
&&
audio
.
pause
()
&&
audio
.
remove
();
}
}
document
.
addEventListener
(
'visibilitychange'
,
visibilitychange
);
document
.
addEventListener
(
'visibilitychange'
,
visibilitychange
);
...
@@ -735,6 +735,7 @@ Jensen.prototype.getFile = async function (filename, length, ondata, onprogress)
...
@@ -735,6 +735,7 @@ Jensen.prototype.getFile = async function (filename, length, ondata, onprogress)
ondata
(
msg
.
body
);
ondata
(
msg
.
body
);
if
(
flen
>=
length
)
{
if
(
flen
>=
length
)
{
document
.
removeEventListener
(
'visibilitychange'
,
visibilitychange
);
document
.
removeEventListener
(
'visibilitychange'
,
visibilitychange
);
Logger
.
info
(
'file download finish.'
)
removeAudio
();
removeAudio
();
// return OK indicates all file blocks received
// return OK indicates all file blocks received
return
'OK'
;
return
'OK'
;
...
@@ -742,6 +743,7 @@ Jensen.prototype.getFile = async function (filename, length, ondata, onprogress)
...
@@ -742,6 +743,7 @@ Jensen.prototype.getFile = async function (filename, length, ondata, onprogress)
}
else
{
}
else
{
document
.
removeEventListener
(
'visibilitychange'
,
visibilitychange
);
document
.
removeEventListener
(
'visibilitychange'
,
visibilitychange
);
removeAudio
();
removeAudio
();
Logger
.
info
(
'file download fail.'
)
ondata
(
'fail'
);
ondata
(
'fail'
);
}
}
};
};
...
...
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