Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
J
JM-15
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-15
Commits
d7b61dd6
Commit
d7b61dd6
authored
Sep 27, 2021
by
limingzhe
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 图片展示异常 upload url异常
parent
94ba8007
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
9 deletions
+19
-9
play.component.html
src/app/play/play.component.html
+0
-7
play.component.ts
src/app/play/play.component.ts
+19
-2
No files found.
src/app/play/play.component.html
View file @
d7b61dd6
...
@@ -10,13 +10,6 @@
...
@@ -10,13 +10,6 @@
</div>
</div>
<div
#
iframeContent
style=
"position: absolute; top: 0; overflow: hidden; "
>
<div
*
ngFor=
"let t of templateArr; let i = index"
>
<iframe
*
ngIf=
"!t.isHide"
[
style
.
width
]="
t
?.
leftOff
||
'
0vw
'"
[
src
]="
t
?.
playUrl
||
safeDefaultUrl
"
style=
"position: fixed; width: 100vw; height: 100vh; border: 0px solid #ccc; "
frameborder=
"0"
>
</iframe>
</div>
</div>
<!-- <div style="position: absolute; top: 0">
<!-- <div style="position: absolute; top: 0">
<label style="font-family: Aileron-Black;"></label>
<label style="font-family: Aileron-Black;"></label>
<label style="font-family: DroidSansFallback;"></label>
<label style="font-family: DroidSansFallback;"></label>
...
...
src/app/play/play.component.ts
View file @
d7b61dd6
...
@@ -330,7 +330,9 @@ export class PlayComponent implements OnInit, OnDestroy {
...
@@ -330,7 +330,9 @@ export class PlayComponent implements OnInit, OnDestroy {
this
.
uploadUrl
=
(
<
any
>
window
).
courseware
.
uploadUrl
();
this
.
uploadUrl
=
(
<
any
>
window
).
courseware
.
uploadUrl
();
window
[
'
air
'
].
getUploadCallback
=
(
url
,
data
)
=>
{
this
.
uploadUrl
=
url
;
};
...
@@ -492,6 +494,15 @@ export class PlayComponent implements OnInit, OnDestroy {
...
@@ -492,6 +494,15 @@ export class PlayComponent implements OnInit, OnDestroy {
}
}
};
};
let
arr
=
contentObj
.
hotZoneItemArr
;
if
(
arr
)
{
for
(
let
i
=
0
;
i
<
arr
.
length
;
i
++
)
{
console
.
log
(
'
arr[i].pic_url:
'
,
arr
[
i
].
pic_url
);
addPicUrl
(
arr
[
i
].
pic_url
);
}
}
addPicUrl
(
contentObj
.
bgItem
?.
url
||
''
);
addPicUrl
(
contentObj
.
bgItem
?.
url
||
''
);
addPicUrl
(
contentObj
.
bg_url
||
''
);
addPicUrl
(
contentObj
.
bg_url
||
''
);
...
@@ -3070,7 +3081,7 @@ export class PlayComponent implements OnInit, OnDestroy {
...
@@ -3070,7 +3081,7 @@ export class PlayComponent implements OnInit, OnDestroy {
const
p
=
this
.
preload
(
value
)
const
p
=
this
.
preload
(
value
)
.
then
(
img
=>
{
.
then
(
img
=>
{
img
[
'
setAttribute
'
](
"
crossOrigin
"
,
'
Anonymous
'
)
//
img['setAttribute']("crossOrigin",'Anonymous')
this
.
images
.
set
(
key
,
img
);
this
.
images
.
set
(
key
,
img
);
})
})
...
@@ -3095,6 +3106,7 @@ export class PlayComponent implements OnInit, OnDestroy {
...
@@ -3095,6 +3106,7 @@ export class PlayComponent implements OnInit, OnDestroy {
preload
(
url
)
{
preload
(
url
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
const
img
=
new
Image
();
const
img
=
new
Image
();
img
[
'
crossOrigin
'
]
=
"
Anonymous
"
;
// img.crossOrigin = "anonymous";
// img.crossOrigin = "anonymous";
img
.
onload
=
()
=>
resolve
(
img
);
img
.
onload
=
()
=>
resolve
(
img
);
img
.
onerror
=
reject
;
img
.
onerror
=
reject
;
...
@@ -3242,6 +3254,11 @@ export class PlayComponent implements OnInit, OnDestroy {
...
@@ -3242,6 +3254,11 @@ export class PlayComponent implements OnInit, OnDestroy {
convertCanvasToImage
()
{
convertCanvasToImage
()
{
console
.
log
(
'
1
'
);
console
.
log
(
'
1
'
);
if
(
!
this
.
uploadUrl
)
{
this
.
userResultPic
=
true
this
.
sendResult
();
return
}
console
.
log
(
'
2 uploadUrl:
'
,
this
.
uploadUrl
.
toString
());
console
.
log
(
'
2 uploadUrl:
'
,
this
.
uploadUrl
.
toString
());
const
src
=
this
.
canvas
.
nativeElement
.
toDataURL
(
"
image/png
"
);
const
src
=
this
.
canvas
.
nativeElement
.
toDataURL
(
"
image/png
"
);
...
...
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