Commit 2d7921af authored by 李维's avatar 李维

修复实体机器播放被遮挡的问题

parent 71939b6a
......@@ -81,7 +81,7 @@
"__id__": 10
},
{
"__id__": 24
"__id__": 13
},
{
"__id__": 32
......@@ -479,18 +479,14 @@
"_parent": {
"__id__": 2
},
"_children": [
{
"__id__": 11
}
],
"_children": [],
"_active": true,
"_components": [
{
"__id__": 22
"__id__": 11
},
{
"__id__": 23
"__id__": 12
}
],
"_prefab": null,
......@@ -541,28 +537,87 @@
"groupIndex": 0,
"_id": "8bh6JRKctMb4af0b6FjAsw"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 10
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "7b1b9a24-6ffe-428a-94f7-a4167e2f58c9"
},
"_type": 0,
"_sizeMode": 0,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "60b9cz3NtNuKZFQjyHyQpB"
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 10
},
"_enabled": true,
"alignMode": 1,
"_target": null,
"_alignFlags": 45,
"_left": 1.9539925233402755e-14,
"_right": -1.9539925233402755e-14,
"_top": 0,
"_bottom": 0,
"_verticalCenter": 0,
"_horizontalCenter": 0,
"_isAbsLeft": true,
"_isAbsRight": true,
"_isAbsTop": true,
"_isAbsBottom": true,
"_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true,
"_originalWidth": 1280,
"_originalHeight": 720,
"_id": "1dKfUaGQFC6YdTHXw74j25"
},
{
"__type__": "cc.Node",
"_name": "bgNode",
"_name": "video_node",
"_objFlags": 0,
"_parent": {
"__id__": 10
"__id__": 2
},
"_children": [
{
"__id__": 12
"__id__": 14
},
{
"__id__": 15
"__id__": 17
},
{
"__id__": 18
"__id__": 20
}
],
"_active": true,
"_components": [
{
"__id__": 21
"__id__": 31
}
],
"_prefab": null,
......@@ -576,8 +631,8 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 1920,
"height": 1080
"width": 870,
"height": 542
},
"_anchorPoint": {
"__type__": "cc.Vec2",
......@@ -588,8 +643,8 @@
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
0,
-6.121,
141.782,
0,
0,
0,
......@@ -611,23 +666,23 @@
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "a45Agfi/ZP8JMF0qy3U0wQ"
"_id": "79FcrfhAJB1ZxFy+oGarZx"
},
{
"__type__": "cc.Node",
"_name": "bg_bottom",
"_name": "bg",
"_objFlags": 0,
"_parent": {
"__id__": 11
"__id__": 13
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 13
"__id__": 15
},
{
"__id__": 14
"__id__": 16
}
],
"_prefab": null,
......@@ -642,7 +697,7 @@
"_contentSize": {
"__type__": "cc.Size",
"width": 1920,
"height": 548
"height": 1080
},
"_anchorPoint": {
"__type__": "cc.Vec2",
......@@ -653,8 +708,8 @@
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
-265.029,
6.120999999999981,
-141.78200000000004,
0,
0,
0,
......@@ -676,14 +731,14 @@
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "efXCK6H4JD46f18GwkLeUQ"
"_id": "b2+lhhTKtNL6XR+jCG2/Ql"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 12
"__id__": 14
},
"_enabled": true,
"_materials": [
......@@ -694,7 +749,7 @@
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "234ab084-10f0-444b-9317-05a2e79fc865"
"__uuid__": "7b1b9a24-6ffe-428a-94f7-a4167e2f58c9"
},
"_type": 0,
"_sizeMode": 0,
......@@ -708,19 +763,21 @@
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "3dA0yKMQFM8rMIZ1FdjCFM"
"_id": "2dVQ2ey6VK+ate9eifEqQl"
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 12
"__id__": 14
},
"_enabled": true,
"alignMode": 1,
"_target": null,
"_alignFlags": 40,
"_target": {
"__id__": 2
},
"_alignFlags": 45,
"_left": 0,
"_right": 0,
"_top": 0,
......@@ -733,27 +790,24 @@
"_isAbsBottom": true,
"_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true,
"_originalWidth": 1920,
"_originalHeight": 0,
"_id": "aeJPNkD8hOWa8E5gRqq8jh"
"_originalWidth": 1280,
"_originalHeight": 720,
"_id": "97UJh8Q/NAPp9mayeavQUf"
},
{
"__type__": "cc.Node",
"_name": "bg_left",
"_name": "videoBg",
"_objFlags": 0,
"_parent": {
"__id__": 11
"__id__": 13
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 16
},
"_children": [
{
"__id__": 17
"__id__": 18
}
],
"_active": true,
"_components": [],
"_prefab": null,
"_opacity": 255,
"_color": {
......@@ -765,8 +819,8 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 223,
"height": 274
"width": 0,
"height": 0
},
"_anchorPoint": {
"__type__": "cc.Vec2",
......@@ -777,8 +831,8 @@
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
-848.5,
298.628,
0,
-114.509,
0,
0,
0,
......@@ -800,82 +854,20 @@
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "c6JjJ6+T1B+a0tWX1JMSiJ"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 15
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "6f7064ca-1a2b-40d6-9fd1-bee219ca78a8"
},
"_type": 0,
"_sizeMode": 1,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "9fCR3B1+BHEYugNSHWoxl0"
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 15
},
"_enabled": true,
"alignMode": 1,
"_target": null,
"_alignFlags": 9,
"_left": 0,
"_right": 0,
"_top": 104.37200000000001,
"_bottom": 0,
"_verticalCenter": 0,
"_horizontalCenter": 0,
"_isAbsLeft": true,
"_isAbsRight": true,
"_isAbsTop": true,
"_isAbsBottom": true,
"_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true,
"_originalWidth": 0,
"_originalHeight": 0,
"_id": "5dETiB2RJCGqPqkd1R+frC"
"_id": "f2bfQ/iz9Kvbrhk3CR7krH"
},
{
"__type__": "cc.Node",
"_name": "bg_right",
"_name": "bg_video_bottom",
"_objFlags": 0,
"_parent": {
"__id__": 11
"__id__": 17
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 19
},
{
"__id__": 20
}
],
"_prefab": null,
......@@ -889,8 +881,8 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 200,
"height": 327
"width": 971,
"height": 717
},
"_anchorPoint": {
"__type__": "cc.Vec2",
......@@ -901,8 +893,8 @@
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
860,
161.47000000000003,
-3.9589999999999996,
97.67,
0,
0,
0,
......@@ -924,7 +916,7 @@
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "c1+LQpeDxL/5GI+aUXp6eQ"
"_id": "dfu8qR4S5Aw77mPYJ1sJq6"
},
{
"__type__": "cc.Sprite",
......@@ -942,7 +934,7 @@
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "8274ddd3-3e42-4e68-aa18-1cfc3385f7c7"
"__uuid__": "bbf1e3a9-27e1-420a-adf7-4bede4e54e51"
},
"_type": 0,
"_sizeMode": 1,
......@@ -956,140 +948,30 @@
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "58JRi99SVI7qz9iNwCmL0O"
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 18
},
"_enabled": true,
"alignMode": 1,
"_target": null,
"_alignFlags": 32,
"_left": 0,
"_right": 0,
"_top": 215.02999999999997,
"_bottom": 0,
"_verticalCenter": 0,
"_horizontalCenter": 0,
"_isAbsLeft": true,
"_isAbsRight": true,
"_isAbsTop": true,
"_isAbsBottom": true,
"_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true,
"_originalWidth": 0,
"_originalHeight": 0,
"_id": "e8GntbbAFBs6vbHsdIoodR"
"_id": "babn0UewpJJ7bF/2HBprFh"
},
{
"__type__": "cc.Widget",
"_name": "",
"__type__": "cc.Node",
"_name": "bgNode",
"_objFlags": 0,
"node": {
"__id__": 11
},
"_enabled": true,
"alignMode": 1,
"_target": null,
"_alignFlags": 45,
"_left": 0,
"_right": 0,
"_top": 0,
"_bottom": 0,
"_verticalCenter": 0,
"_horizontalCenter": 0,
"_isAbsLeft": true,
"_isAbsRight": true,
"_isAbsTop": true,
"_isAbsBottom": true,
"_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true,
"_originalWidth": 0,
"_originalHeight": 0,
"_id": "d7qg9LKlZCZZzy6BXtjDnU"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 10
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "7b1b9a24-6ffe-428a-94f7-a4167e2f58c9"
},
"_type": 0,
"_sizeMode": 0,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "60b9cz3NtNuKZFQjyHyQpB"
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 10
},
"_enabled": true,
"alignMode": 1,
"_target": null,
"_alignFlags": 45,
"_left": 1.9539925233402755e-14,
"_right": -1.9539925233402755e-14,
"_top": 0,
"_bottom": 0,
"_verticalCenter": 0,
"_horizontalCenter": 0,
"_isAbsLeft": true,
"_isAbsRight": true,
"_isAbsTop": true,
"_isAbsBottom": true,
"_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true,
"_originalWidth": 1280,
"_originalHeight": 720,
"_id": "1dKfUaGQFC6YdTHXw74j25"
},
{
"__type__": "cc.Node",
"_name": "video_node",
"_objFlags": 0,
"_parent": {
"__id__": 2
"_parent": {
"__id__": 13
},
"_children": [
{
"__id__": 25
"__id__": 21
},
{
"__id__": 28
"__id__": 24
},
{
"__id__": 27
}
],
"_active": true,
"_components": [
{
"__id__": 31
"__id__": 30
}
],
"_prefab": null,
......@@ -1115,8 +997,8 @@
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
-6.121,
141.782,
0,
0,
0,
0,
0,
......@@ -1138,23 +1020,23 @@
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "79FcrfhAJB1ZxFy+oGarZx"
"_id": "a45Agfi/ZP8JMF0qy3U0wQ"
},
{
"__type__": "cc.Node",
"_name": "bg",
"_name": "bg_bottom",
"_objFlags": 0,
"_parent": {
"__id__": 24
"__id__": 20
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 26
"__id__": 22
},
{
"__id__": 27
"__id__": 23
}
],
"_prefab": null,
......@@ -1169,7 +1051,7 @@
"_contentSize": {
"__type__": "cc.Size",
"width": 1920,
"height": 1080
"height": 548
},
"_anchorPoint": {
"__type__": "cc.Vec2",
......@@ -1180,8 +1062,8 @@
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
6.307999999999993,
-178.485,
6.120999999999981,
-407.78200000000004,
0,
0,
0,
......@@ -1203,14 +1085,14 @@
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "b2+lhhTKtNL6XR+jCG2/Ql"
"_id": "efXCK6H4JD46f18GwkLeUQ"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 25
"__id__": 21
},
"_enabled": true,
"_materials": [
......@@ -1218,10 +1100,10 @@
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_srcBlendFactor": 1,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "7b1b9a24-6ffe-428a-94f7-a4167e2f58c9"
"__uuid__": "234ab084-10f0-444b-9317-05a2e79fc865"
},
"_type": 0,
"_sizeMode": 0,
......@@ -1235,23 +1117,25 @@
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "2dVQ2ey6VK+ate9eifEqQl"
"_id": "3dA0yKMQFM8rMIZ1FdjCFM"
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 25
"__id__": 21
},
"_enabled": true,
"alignMode": 1,
"_target": null,
"_alignFlags": 45,
"_left": -518.692,
"_right": -531.308,
"_top": -90.51500000000013,
"_bottom": -447.485,
"_target": {
"__id__": 2
},
"_alignFlags": 44,
"_left": 0,
"_right": 0,
"_top": 0,
"_bottom": 0,
"_verticalCenter": 0,
"_horizontalCenter": 0,
"_isAbsLeft": true,
......@@ -1260,24 +1144,27 @@
"_isAbsBottom": true,
"_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true,
"_originalWidth": 1280,
"_originalHeight": 720,
"_id": "97UJh8Q/NAPp9mayeavQUf"
"_originalWidth": 1920,
"_originalHeight": 0,
"_id": "aeJPNkD8hOWa8E5gRqq8jh"
},
{
"__type__": "cc.Node",
"_name": "videoBg",
"_name": "bg_left",
"_objFlags": 0,
"_parent": {
"__id__": 24
"__id__": 20
},
"_children": [
"_children": [],
"_active": true,
"_components": [
{
"__id__": 29
"__id__": 25
},
{
"__id__": 26
}
],
"_active": true,
"_components": [],
"_prefab": null,
"_opacity": 255,
"_color": {
......@@ -1289,8 +1176,8 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 0,
"height": 0
"width": 223,
"height": 274
},
"_anchorPoint": {
"__type__": "cc.Vec2",
......@@ -1301,8 +1188,8 @@
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
-114.509,
-842.379,
111.21799999999999,
0,
0,
0,
......@@ -1324,20 +1211,84 @@
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "f2bfQ/iz9Kvbrhk3CR7krH"
"_id": "c6JjJ6+T1B+a0tWX1JMSiJ"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 24
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 1,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "6f7064ca-1a2b-40d6-9fd1-bee219ca78a8"
},
"_type": 0,
"_sizeMode": 1,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "9fCR3B1+BHEYugNSHWoxl0"
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 24
},
"_enabled": true,
"alignMode": 1,
"_target": {
"__id__": 2
},
"_alignFlags": 9,
"_left": 0,
"_right": 0,
"_top": 150,
"_bottom": 0,
"_verticalCenter": 0,
"_horizontalCenter": 0,
"_isAbsLeft": true,
"_isAbsRight": true,
"_isAbsTop": true,
"_isAbsBottom": true,
"_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true,
"_originalWidth": 0,
"_originalHeight": 0,
"_id": "5dETiB2RJCGqPqkd1R+frC"
},
{
"__type__": "cc.Node",
"_name": "bg_video_bottom",
"_name": "bg_right",
"_objFlags": 0,
"_parent": {
"__id__": 28
"__id__": 20
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 30
"__id__": 28
},
{
"__id__": 29
}
],
"_prefab": null,
......@@ -1351,8 +1302,8 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 971,
"height": 717
"width": 200,
"height": 327
},
"_anchorPoint": {
"__type__": "cc.Vec2",
......@@ -1363,8 +1314,8 @@
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
-3.9589999999999996,
97.67,
866.121,
161.47000000000003,
0,
0,
0,
......@@ -1386,14 +1337,14 @@
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "dfu8qR4S5Aw77mPYJ1sJq6"
"_id": "c1+LQpeDxL/5GI+aUXp6eQ"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 29
"__id__": 27
},
"_enabled": true,
"_materials": [
......@@ -1401,10 +1352,10 @@
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_srcBlendFactor": 1,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "bbf1e3a9-27e1-420a-adf7-4bede4e54e51"
"__uuid__": "8274ddd3-3e42-4e68-aa18-1cfc3385f7c7"
},
"_type": 0,
"_sizeMode": 1,
......@@ -1418,14 +1369,70 @@
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "babn0UewpJJ7bF/2HBprFh"
"_id": "58JRi99SVI7qz9iNwCmL0O"
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 27
},
"_enabled": true,
"alignMode": 1,
"_target": {
"__id__": 2
},
"_alignFlags": 32,
"_left": 0,
"_right": 0,
"_top": 215.02999999999997,
"_bottom": 0,
"_verticalCenter": 0,
"_horizontalCenter": 0,
"_isAbsLeft": true,
"_isAbsRight": true,
"_isAbsTop": true,
"_isAbsBottom": true,
"_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true,
"_originalWidth": 0,
"_originalHeight": 0,
"_id": "e8GntbbAFBs6vbHsdIoodR"
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 20
},
"_enabled": true,
"alignMode": 1,
"_target": null,
"_alignFlags": 45,
"_left": 1.9539925233402755e-14,
"_right": -1.9539925233402755e-14,
"_top": -2.842170943040401e-14,
"_bottom": 2.842170943040401e-14,
"_verticalCenter": 0,
"_horizontalCenter": 0,
"_isAbsLeft": true,
"_isAbsRight": true,
"_isAbsTop": true,
"_isAbsBottom": true,
"_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true,
"_originalWidth": 0,
"_originalHeight": 0,
"_id": "d7qg9LKlZCZZzy6BXtjDnU"
},
{
"__type__": "cc.Mask",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 24
"__id__": 13
},
"_enabled": true,
"_materials": [
......
......@@ -52,7 +52,7 @@ export default class VideoPlayerComponent extends cc.Component {
initSize() {
let screen_size = cc.view.getFrameSize().width / cc.view.getFrameSize().height;
let design_size = cc.Canvas.instance.designResolution.width / cc.Canvas.instance.designResolution.height;
console.log("原本尺寸",screen_size,"现在尺寸",design_size)
let f = screen_size >= design_size;
cc.Canvas.instance.fitHeight = f;
cc.Canvas.instance.fitWidth = !f;
......@@ -71,9 +71,6 @@ export default class VideoPlayerComponent extends cc.Component {
this._mapScaleMin = Math.min(sx, sy) * this._cocosScale;
this._mapScaleMax = Math.max(sx, sy) * this._cocosScale;
console.log("原本宽度",cc.director["_scene"].width,"现在宽度",frameSize.width)
console.log("原本高度",cc.director["_scene"].height,"现在高度",frameSize.height)
cc.director["_scene"].width = frameSize.width;
cc.director["_scene"].height = frameSize.height;
}
......@@ -137,8 +134,8 @@ export default class VideoPlayerComponent extends cc.Component {
cc.debug.setDisplayStats(false);
this.initSize();
cc.find('Canvas/bg').scale = this._mapScaleMax;
cc.find('Canvas/video_node/bg').scale = this._mapScaleMax;
// cc.find('Canvas/bg').scale = this._mapScaleMax;
// cc.find('Canvas/video_node/bg').scale = this._mapScaleMax;
// cc.find('Canvas/bgwhite').zIndex=-2
// cc.find('Canvas/bg').zIndex=-1
......@@ -208,20 +205,19 @@ export default class VideoPlayerComponent extends cc.Component {
}
});
this.videoPlayer.node.on('playing', () => {
console.log('playing');
this.durationLabel.string = this.formatTime(this.videoPlayer.getDuration());
this.playButton.node.active = false;
this.restartButton.node.active = false;
this.pauseButton.node.active = true;
});
this.videoPlayer.node.on('paused', () => {
console.log('paused');
});
this.videoPlayer.node.on('stopped', () => {
console.log('stopped');
});
this.videoPlayer.node.on('completed', async () => {
console.log('completed');
this._isPlayComplated = true;
this.playButton.node.active = false;
this.pauseButton.node.active = false;
......@@ -235,7 +231,6 @@ export default class VideoPlayerComponent extends cc.Component {
}
});
cc.view.setResizeCallback(() => {
console.log('Resize');
this.initdDrag();
});
......@@ -250,6 +245,7 @@ export default class VideoPlayerComponent extends cc.Component {
if (this.videoItemList)
cc.find("Canvas/btn_next").active=this.videoPlayIndex!=this.videoItemList.length-1
}
onClickNext(){
const nextItem = this.videoItemList[this.videoPlayIndex + 1];
if (nextItem) {
......@@ -259,6 +255,7 @@ export default class VideoPlayerComponent extends cc.Component {
}
this.refreshLastNextBtns()
}
onClickLast(){
const nextItem = this.videoItemList[this.videoPlayIndex - 1];
if (nextItem) {
......@@ -272,7 +269,6 @@ export default class VideoPlayerComponent extends cc.Component {
initListener() {
if (window['air']) {
window["air"].dialogStatus = (statusCode: number) => {
console.log("缓冲", statusCode);
if (statusCode == 701) {
this.loadingSprite.active = true;
} else if (statusCode == 702) {
......@@ -291,7 +287,6 @@ export default class VideoPlayerComponent extends cc.Component {
if (!this._isReadyToPlay) {
return;
}
console.log("TOUCH_START");
});
this.barTag.off(cc.Node.EventType.TOUCH_MOVE);
this.barTag.on(cc.Node.EventType.TOUCH_MOVE, (e) => {
......@@ -313,7 +308,6 @@ export default class VideoPlayerComponent extends cc.Component {
if (!this._isReadyToPlay) {
return;
}
console.log("TOUCH_ENDED");
this.updateBarByPos(this.barTag.x);
});
this.barTag.off(cc.Node.EventType.MOUSE_UP);
......@@ -321,7 +315,6 @@ export default class VideoPlayerComponent extends cc.Component {
if (!this._isReadyToPlay) {
return;
}
console.log("MOUSE_UP");
this.updateBarByPos(this.barTag.x);
});
}
......@@ -441,9 +434,8 @@ export default class VideoPlayerComponent extends cc.Component {
}
cc.find(`Canvas/videolist`).active = this.data.dataArr.length>1;
if (this.data.dataArr.length<=1){
console.log("qsj???")
cc.find(`Canvas/bg/videoBg`).scale=1.2
cc.find(`Canvas/bg/videoBg`).y=-136.058
cc.find(`Canvas/video_node/videoBg`).scale=1.2
cc.find(`Canvas/video_node/videoBg`).y=-136.058
// cc.find(`Canvas/video_node`).scale=1.2
cc.find(`Canvas/video_node`).width*=1.2
cc.find(`Canvas/video_node`).height*=1.2
......@@ -531,18 +523,15 @@ export default class VideoPlayerComponent extends cc.Component {
}
play() {
console.log("PL")
if (!this._isReadyToPlay) {
return;
}
const { width, height } = cc.find(`Canvas/bg`);
cc.find(`Canvas/text_tips`).active = false;
// cc.find(`Canvas/bg`).active = false;
cc.find(`Canvas/bg`).active = false;
cc.find(`Canvas/bgwhite`).active = false;
const videoContainer = cc.find('Canvas/video_node');
cc.find('bg', videoContainer).width = width;
cc.find('bg', videoContainer).height = height;
this.videoPlayer.node.x = videoContainer.x;
this.videoPlayer.node.y = videoContainer.y;
this.videoPlayer.play();
......@@ -682,8 +671,6 @@ export default class VideoPlayerComponent extends cc.Component {
}
update(dt: number) {
console.log("==VIDEO==",this.node.active);
if (!this._isReadyToPlay) {
return;
}
......
......@@ -4,7 +4,7 @@
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"premultiplyAlpha": true,
"genMipmaps": false,
"packable": true,
"width": 1920,
......
......@@ -4,7 +4,7 @@
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"premultiplyAlpha": true,
"genMipmaps": false,
"packable": true,
"width": 223,
......
......@@ -4,7 +4,7 @@
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"premultiplyAlpha": true,
"genMipmaps": false,
"packable": true,
"width": 200,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment