Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
H
hw_online_005
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
template admin
hw_online_005
Commits
83e23f5b
Commit
83e23f5b
authored
Apr 01, 2020
by
limingzhe
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update startBtn touch enable
parent
6c59cff2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
43 additions
and
16 deletions
+43
-16
play.component.ts
src/app/play/play.component.ts
+43
-16
No files found.
src/app/play/play.component.ts
View file @
83e23f5b
...
...
@@ -218,15 +218,27 @@ export class PlayComponent implements OnInit, OnDestroy {
load
()
{
// window["air"].hideAirClassLoading(this.saveKey, this.data);
// console.log('in load 1');
this
.
loadResources
().
then
(()
=>
{
// console.log('in load 2');
this
.
init
();
// console.log('in load 3');
this
.
update
();
// console.log('in load 4');
this
.
addServerListener
();
// console.log('in load 5');
window
[
"
air
"
].
hideAirClassLoading
(
this
.
saveKey
,
this
.
data
);
// console.log('in load 6');
});
}
...
...
@@ -273,6 +285,7 @@ export class PlayComponent implements OnInit, OnDestroy {
const
c
=
(
<
any
>
window
).
courseware
;
c
.
onEvent
(
'
userchange
'
,
(
data
,
next
)
=>
{
//data的结构如下
/*{
...
...
@@ -336,6 +349,8 @@ export class PlayComponent implements OnInit, OnDestroy {
this
.
teacherPage
.
visible
=
true
;
}
this
.
canTouch
=
true
;
next
();
});
...
...
@@ -394,7 +409,6 @@ export class PlayComponent implements OnInit, OnDestroy {
this
.
addTeacherPageData
(
data
);
}
next
();
});
...
...
@@ -600,19 +614,25 @@ export class PlayComponent implements OnInit, OnDestroy {
playAudio
(
key
,
now
=
false
,
callback
=
null
)
{
const
audio
=
this
.
audioObj
[
key
];
if
(
audio
)
{
if
(
now
)
{
audio
.
pause
();
audio
.
currentTime
=
0
;
}
if
(
callback
)
{
audio
.
onended
=
()
=>
{
callback
();
};
try
{
if
(
audio
)
{
if
(
now
)
{
audio
.
pause
();
audio
.
currentTime
=
0
;
}
if
(
callback
)
{
audio
.
onended
=
()
=>
{
callback
();
};
}
audio
.
play
();
}
audio
.
play
();
}
catch
(
e
)
{
console
.
log
(
'
e:
'
,
e
);
}
}
...
...
@@ -656,14 +676,21 @@ export class PlayComponent implements OnInit, OnDestroy {
preloadAudio
(
url
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
const
audio
=
new
Audio
();
audio
.
oncanplay
=
(
a
)
=>
{
resolve
();
};
// audio.addEventListener('loadedmetadata', () => {
// resolve();
// });
// audio.oncanplay = (a) => {
// resolve();
// };
audio
.
onerror
=
()
=>
{
reject
();
};
audio
.
src
=
url
;
audio
.
load
();
resolve
();
});
}
...
...
@@ -884,8 +911,6 @@ export class PlayComponent implements OnInit, OnDestroy {
this
.
syncPage
();
}
syncPage
()
{
...
...
@@ -2554,6 +2579,8 @@ export class PlayComponent implements OnInit, OnDestroy {
this
.
sendServerEvent
(
'
startGame
'
,
{
roleData
,
roleIndex
,
wordArr
,
gameResultArr
,
date
,
start
:
true
});
this
.
canTouch
=
false
;
}
sendServerNewRound
()
{
...
...
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