Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
J
JM_4-1
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
JM_4-1
Commits
def3657a
Commit
def3657a
authored
Aug 25, 2021
by
limingzhe
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: course in msg
parent
ed3e411d
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
0 deletions
+30
-0
play.component.ts
src/app/play/play.component.ts
+30
-0
No files found.
src/app/play/play.component.ts
View file @
def3657a
...
@@ -1444,6 +1444,8 @@ export class PlayComponent implements OnInit, OnDestroy {
...
@@ -1444,6 +1444,8 @@ export class PlayComponent implements OnInit, OnDestroy {
console
.
log
(
'
progress:
'
,
progress
);
console
.
log
(
'
progress:
'
,
progress
);
if
(
progress
==
'
2
'
)
{
if
(
progress
==
'
2
'
)
{
if
(
this
.
submitCount
==
1
)
{
if
(
this
.
submitCount
==
1
)
{
this
.
showSubTemplate
(
1
);
this
.
showSubTemplate
(
1
);
...
@@ -1835,6 +1837,10 @@ export class PlayComponent implements OnInit, OnDestroy {
...
@@ -1835,6 +1837,10 @@ export class PlayComponent implements OnInit, OnDestroy {
arr
[
index
].
leftOff
=
'
100vw
'
;
arr
[
index
].
leftOff
=
'
100vw
'
;
this
.
appRef
.
tick
();
this
.
appRef
.
tick
();
if
(
this
.
readyObj
[(
index
+
1
).
toString
()])
{
this
.
sendCourseIn
(
index
);
}
}
}
...
@@ -1847,6 +1853,7 @@ export class PlayComponent implements OnInit, OnDestroy {
...
@@ -1847,6 +1853,7 @@ export class PlayComponent implements OnInit, OnDestroy {
iframeArr
;
iframeArr
;
readyObj
;
initWindowListener
()
{
initWindowListener
()
{
...
@@ -1866,6 +1873,7 @@ export class PlayComponent implements OnInit, OnDestroy {
...
@@ -1866,6 +1873,7 @@ export class PlayComponent implements OnInit, OnDestroy {
// console.log('iframeArr: ', iframeArr);
// console.log('iframeArr: ', iframeArr);
// // }, 1);
// // }, 1);
this
.
readyObj
=
{};
window
.
addEventListener
(
'
message
'
,
(
e
)
=>
{
window
.
addEventListener
(
'
message
'
,
(
e
)
=>
{
...
@@ -1940,11 +1948,33 @@ export class PlayComponent implements OnInit, OnDestroy {
...
@@ -1940,11 +1948,33 @@ export class PlayComponent implements OnInit, OnDestroy {
}
}
if
(
msgData
.
action
==
'
course-ready
'
)
{
console
.
log
(
'
in course-ready msgData:
'
,
msgData
)
console
.
log
(
'
msgData.urlParams:
'
,
msgData
);
const
key
=
this
.
getQueryVariable
(
msgData
.
urlParams
,
'
key
'
);
if
(
!
key
)
{
return
;
}
this
.
readyObj
[
key
]
=
true
;
}
});
});
}
}
sendCourseIn
(
index
)
{
const
divArr
=
this
.
iframeContent
.
nativeElement
.
children
;
const
iframecont
=
divArr
[
index
].
children
[
0
];
const
data
=
{
msg
:
'
success
'
,
data
:
''
};
iframecont
.
contentWindow
.
postMessage
({
action
:
'
airEvents
'
,
evt
:
'
course-in-screen
'
,
data
:
JSON
.
stringify
(
data
)
},
'
*
'
);
}
getQueryVariable
(
url
,
variable
)
{
getQueryVariable
(
url
,
variable
)
{
var
query
=
url
.
substring
(
1
);
var
query
=
url
.
substring
(
1
);
...
...
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