Commit bb6a3fd4 authored by 李维's avatar 李维

添加视频背景

parent fccce5a8
......@@ -72,31 +72,31 @@
"__id__": 3
},
{
"__id__": 7
"__id__": 6
},
{
"__id__": 10
"__id__": 11
},
{
"__id__": 12
"__id__": 13
},
{
"__id__": 14
"__id__": 15
},
{
"__id__": 43
"__id__": 44
}
],
"_active": true,
"_components": [
{
"__id__": 69
},
{
"__id__": 70
},
{
"__id__": 71
},
{
"__id__": 72
}
],
"_prefab": null,
......@@ -149,20 +149,19 @@
},
{
"__type__": "cc.Node",
"_name": "video_bg",
"_name": "Main Camera",
"_objFlags": 0,
"_parent": {
"__id__": 2
},
"_children": [
{
"__id__": 4
}
],
"_children": [],
"_active": true,
"_components": [
{
"__id__": 6
"__id__": 4
},
{
"__id__": 5
}
],
"_prefab": null,
......@@ -176,8 +175,8 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 1280,
"height": 940
"width": 0,
"height": 0
},
"_anchorPoint": {
"__type__": "cc.Vec2",
......@@ -211,20 +210,87 @@
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "05K9heyf1A5aDb5SYhexfW"
"_id": "e1WoFrQ79G7r4ZuQE3HlNb"
},
{
"__type__": "cc.Camera",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 3
},
"_enabled": true,
"_cullingMask": 4294967295,
"_clearFlags": 7,
"_backgroundColor": {
"__type__": "cc.Color",
"r": 0,
"g": 0,
"b": 0,
"a": 0
},
"_depth": -1,
"_zoomRatio": 1,
"_targetTexture": null,
"_fov": 60,
"_orthoSize": 10,
"_nearClip": 1,
"_farClip": 4096,
"_ortho": true,
"_rect": {
"__type__": "cc.Rect",
"x": 0,
"y": 0,
"width": 1,
"height": 1
},
"_renderStages": 1,
"_alignWithScreen": true,
"_id": "81GN3uXINKVLeW4+iKSlim"
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 3
},
"_enabled": true,
"alignMode": 1,
"_target": null,
"_alignFlags": 45,
"_left": 640,
"_right": 640,
"_top": 470,
"_bottom": 470,
"_verticalCenter": 0,
"_horizontalCenter": 0,
"_isAbsLeft": true,
"_isAbsRight": true,
"_isAbsTop": true,
"_isAbsBottom": true,
"_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true,
"_originalWidth": 1280,
"_originalHeight": 720,
"_id": "a3W+F+0tFAFJzUnY+BaTiV"
},
{
"__type__": "cc.Node",
"_name": "bg_video",
"_name": "video_bg",
"_objFlags": 0,
"_parent": {
"__id__": 3
"__id__": 2
},
"_children": [],
"_children": [
{
"__id__": 7
}
],
"_active": true,
"_components": [
{
"__id__": 5
"__id__": 10
}
],
"_prefab": null,
......@@ -238,8 +304,8 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 2000,
"height": 2000
"width": 0,
"height": 0
},
"_anchorPoint": {
"__type__": "cc.Vec2",
......@@ -273,66 +339,14 @@
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "bf9K6uSIJLK6LC8Qyw6+eT"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 4
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 1,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "5509c4ec-1745-4fdd-9a1d-af63bae692a8"
},
"_type": 0,
"_sizeMode": 1,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "52rlpVhXVHLbhYxcLX3uSD"
},
{
"__type__": "cc.Mask",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 3
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_spriteFrame": null,
"_type": 0,
"_segments": 64,
"_N$alphaThreshold": 0.1,
"_N$inverted": true,
"_id": "74zvqtP2JFya0y/suNoRwM"
"_id": "05K9heyf1A5aDb5SYhexfW"
},
{
"__type__": "cc.Node",
"_name": "Main Camera",
"_name": "bg_video",
"_objFlags": 0,
"_parent": {
"__id__": 2
"__id__": 6
},
"_children": [],
"_active": true,
......@@ -355,8 +369,8 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 0,
"height": 0
"width": 1280,
"height": 940
},
"_anchorPoint": {
"__type__": "cc.Vec2",
......@@ -390,43 +404,39 @@
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "e1WoFrQ79G7r4ZuQE3HlNb"
"_id": "bf9K6uSIJLK6LC8Qyw6+eT"
},
{
"__type__": "cc.Camera",
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 7
},
"_enabled": true,
"_cullingMask": 4294967295,
"_clearFlags": 7,
"_backgroundColor": {
"__type__": "cc.Color",
"r": 0,
"g": 0,
"b": 0,
"a": 0
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 1,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "5509c4ec-1745-4fdd-9a1d-af63bae692a8"
},
"_depth": -1,
"_zoomRatio": 1,
"_targetTexture": null,
"_fov": 60,
"_orthoSize": 10,
"_nearClip": 1,
"_farClip": 4096,
"_ortho": true,
"_rect": {
"__type__": "cc.Rect",
"_type": 0,
"_sizeMode": 0,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0,
"width": 1,
"height": 1
"y": 0
},
"_renderStages": 1,
"_alignWithScreen": true,
"_id": "81GN3uXINKVLeW4+iKSlim"
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "52rlpVhXVHLbhYxcLX3uSD"
},
{
"__type__": "cc.Widget",
......@@ -437,12 +447,14 @@
},
"_enabled": true,
"alignMode": 1,
"_target": null,
"_target": {
"__id__": 2
},
"_alignFlags": 45,
"_left": 640,
"_right": 640,
"_top": 470,
"_bottom": 470,
"_left": 0,
"_right": 0,
"_top": 0,
"_bottom": 0,
"_verticalCenter": 0,
"_horizontalCenter": 0,
"_isAbsLeft": true,
......@@ -451,9 +463,29 @@
"_isAbsBottom": true,
"_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true,
"_originalWidth": 1280,
"_originalHeight": 720,
"_id": "a3W+F+0tFAFJzUnY+BaTiV"
"_originalWidth": 2000,
"_originalHeight": 2000,
"_id": "0c7QcJ1DpJ7rWllRE8Soto"
},
{
"__type__": "cc.Mask",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 6
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_spriteFrame": null,
"_type": 0,
"_segments": 64,
"_N$alphaThreshold": 0.1,
"_N$inverted": true,
"_id": "74zvqtP2JFya0y/suNoRwM"
},
{
"__type__": "cc.Node",
......@@ -466,7 +498,7 @@
"_active": false,
"_components": [
{
"__id__": 11
"__id__": 12
}
],
"_prefab": null,
......@@ -522,7 +554,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 10
"__id__": 11
},
"_enabled": true,
"_materials": [
......@@ -568,7 +600,7 @@
"_active": false,
"_components": [
{
"__id__": 13
"__id__": 14
}
],
"_prefab": null,
......@@ -624,7 +656,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 12
"__id__": 13
},
"_enabled": true,
"_materials": [
......@@ -668,32 +700,32 @@
},
"_children": [
{
"__id__": 15
"__id__": 16
},
{
"__id__": 21
"__id__": 22
},
{
"__id__": 23
"__id__": 24
},
{
"__id__": 34
"__id__": 35
},
{
"__id__": 37
"__id__": 38
}
],
"_active": true,
"_components": [
{
"__id__": 40
"__id__": 41
},
{
"__id__": 41
"__id__": 42
}
],
"_prefab": {
"__id__": 42
"__id__": 43
},
"_opacity": 255,
"_color": {
......@@ -747,21 +779,21 @@
"_name": "progress",
"_objFlags": 0,
"_parent": {
"__id__": 14
"__id__": 15
},
"_children": [
{
"__id__": 16
"__id__": 17
}
],
"_active": true,
"_components": [
{
"__id__": 19
"__id__": 20
}
],
"_prefab": {
"__id__": 20
"__id__": 21
},
"_opacity": 255,
"_color": {
......@@ -815,17 +847,17 @@
"_name": "bar",
"_objFlags": 0,
"_parent": {
"__id__": 15
"__id__": 16
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 17
"__id__": 18
}
],
"_prefab": {
"__id__": 18
"__id__": 19
},
"_opacity": 255,
"_color": {
......@@ -879,7 +911,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 16
"__id__": 17
},
"_enabled": true,
"_materials": [
......@@ -909,7 +941,7 @@
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 14
"__id__": 15
},
"asset": {
"__uuid__": "a1cb871b-6ef5-410e-802f-f3a1c2d185e9"
......@@ -922,7 +954,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 15
"__id__": 16
},
"_enabled": true,
"_materials": [
......@@ -952,7 +984,7 @@
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 14
"__id__": 15
},
"asset": {
"__uuid__": "a1cb871b-6ef5-410e-802f-f3a1c2d185e9"
......@@ -965,13 +997,13 @@
"_name": "markNode",
"_objFlags": 0,
"_parent": {
"__id__": 14
"__id__": 15
},
"_children": [],
"_active": true,
"_components": [],
"_prefab": {
"__id__": 22
"__id__": 23
},
"_opacity": 255,
"_color": {
......@@ -1023,7 +1055,7 @@
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 14
"__id__": 15
},
"asset": {
"__uuid__": "a1cb871b-6ef5-410e-802f-f3a1c2d185e9"
......@@ -1036,23 +1068,23 @@
"_name": "controlButton",
"_objFlags": 0,
"_parent": {
"__id__": 14
"__id__": 15
},
"_children": [
{
"__id__": 24
"__id__": 25
},
{
"__id__": 27
"__id__": 28
},
{
"__id__": 30
"__id__": 31
}
],
"_active": true,
"_components": [],
"_prefab": {
"__id__": 33
"__id__": 34
},
"_opacity": 255,
"_color": {
......@@ -1106,17 +1138,17 @@
"_name": "play",
"_objFlags": 0,
"_parent": {
"__id__": 23
"__id__": 24
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 25
"__id__": 26
}
],
"_prefab": {
"__id__": 26
"__id__": 27
},
"_opacity": 255,
"_color": {
......@@ -1170,7 +1202,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 24
"__id__": 25
},
"_enabled": true,
"_materials": [
......@@ -1200,7 +1232,7 @@
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 14
"__id__": 15
},
"asset": {
"__uuid__": "a1cb871b-6ef5-410e-802f-f3a1c2d185e9"
......@@ -1213,17 +1245,17 @@
"_name": "pause",
"_objFlags": 0,
"_parent": {
"__id__": 23
"__id__": 24
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 28
"__id__": 29
}
],
"_prefab": {
"__id__": 29
"__id__": 30
},
"_opacity": 255,
"_color": {
......@@ -1277,7 +1309,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 27
"__id__": 28
},
"_enabled": true,
"_materials": [
......@@ -1307,7 +1339,7 @@
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 14
"__id__": 15
},
"asset": {
"__uuid__": "a1cb871b-6ef5-410e-802f-f3a1c2d185e9"
......@@ -1320,17 +1352,17 @@
"_name": "replay",
"_objFlags": 0,
"_parent": {
"__id__": 23
"__id__": 24
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 31
"__id__": 32
}
],
"_prefab": {
"__id__": 32
"__id__": 33
},
"_opacity": 255,
"_color": {
......@@ -1384,7 +1416,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 30
"__id__": 31
},
"_enabled": true,
"_materials": [
......@@ -1414,7 +1446,7 @@
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 14
"__id__": 15
},
"asset": {
"__uuid__": "a1cb871b-6ef5-410e-802f-f3a1c2d185e9"
......@@ -1425,7 +1457,7 @@
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 14
"__id__": 15
},
"asset": {
"__uuid__": "a1cb871b-6ef5-410e-802f-f3a1c2d185e9"
......@@ -1438,17 +1470,17 @@
"_name": "dragButton",
"_objFlags": 0,
"_parent": {
"__id__": 14
"__id__": 15
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 35
"__id__": 36
}
],
"_prefab": {
"__id__": 36
"__id__": 37
},
"_opacity": 255,
"_color": {
......@@ -1502,7 +1534,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 34
"__id__": 35
},
"_enabled": true,
"_materials": [
......@@ -1532,7 +1564,7 @@
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 14
"__id__": 15
},
"asset": {
"__uuid__": "a1cb871b-6ef5-410e-802f-f3a1c2d185e9"
......@@ -1545,17 +1577,17 @@
"_name": "markPoint",
"_objFlags": 0,
"_parent": {
"__id__": 14
"__id__": 15
},
"_children": [],
"_active": false,
"_components": [
{
"__id__": 38
"__id__": 39
}
],
"_prefab": {
"__id__": 39
"__id__": 40
},
"_opacity": 255,
"_color": {
......@@ -1609,7 +1641,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 37
"__id__": 38
},
"_enabled": true,
"_materials": [
......@@ -1639,7 +1671,7 @@
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 14
"__id__": 15
},
"asset": {
"__uuid__": "a1cb871b-6ef5-410e-802f-f3a1c2d185e9"
......@@ -1652,7 +1684,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 14
"__id__": 15
},
"_enabled": true,
"_id": "42XWQfk9tE94NY0efe9K5z"
......@@ -1662,7 +1694,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 14
"__id__": 15
},
"_enabled": true,
"alignMode": 1,
......@@ -1687,7 +1719,7 @@
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 14
"__id__": 15
},
"asset": {
"__uuid__": "a1cb871b-6ef5-410e-802f-f3a1c2d185e9"
......@@ -1704,13 +1736,13 @@
},
"_children": [
{
"__id__": 44
"__id__": 45
},
{
"__id__": 59
"__id__": 60
},
{
"__id__": 62
"__id__": 63
}
],
"_active": false,
......@@ -1768,29 +1800,29 @@
"_name": "img",
"_objFlags": 0,
"_parent": {
"__id__": 43
"__id__": 44
},
"_children": [
{
"__id__": 45
"__id__": 46
},
{
"__id__": 47
"__id__": 48
},
{
"__id__": 49
"__id__": 50
},
{
"__id__": 51
"__id__": 52
},
{
"__id__": 53
"__id__": 54
},
{
"__id__": 55
"__id__": 56
},
{
"__id__": 57
"__id__": 58
}
],
"_active": true,
......@@ -1848,13 +1880,13 @@
"_name": "go_1",
"_objFlags": 0,
"_parent": {
"__id__": 44
"__id__": 45
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 46
"__id__": 47
}
],
"_prefab": null,
......@@ -1910,7 +1942,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 45
"__id__": 46
},
"_enabled": true,
"_materials": [],
......@@ -1938,13 +1970,13 @@
"_name": "black",
"_objFlags": 0,
"_parent": {
"__id__": 44
"__id__": 45
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 48
"__id__": 49
}
],
"_prefab": null,
......@@ -2000,7 +2032,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 47
"__id__": 48
},
"_enabled": true,
"_materials": [],
......@@ -2028,13 +2060,13 @@
"_name": "go_3",
"_objFlags": 0,
"_parent": {
"__id__": 44
"__id__": 45
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 50
"__id__": 51
}
],
"_prefab": null,
......@@ -2090,7 +2122,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 49
"__id__": 50
},
"_enabled": true,
"_materials": [],
......@@ -2118,13 +2150,13 @@
"_name": "go_2",
"_objFlags": 0,
"_parent": {
"__id__": 44
"__id__": 45
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 52
"__id__": 53
}
],
"_prefab": null,
......@@ -2180,7 +2212,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 51
"__id__": 52
},
"_enabled": true,
"_materials": [],
......@@ -2208,13 +2240,13 @@
"_name": "start_title",
"_objFlags": 0,
"_parent": {
"__id__": 44
"__id__": 45
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 54
"__id__": 55
}
],
"_prefab": null,
......@@ -2270,7 +2302,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 53
"__id__": 54
},
"_enabled": true,
"_materials": [],
......@@ -2298,13 +2330,13 @@
"_name": "go_0",
"_objFlags": 0,
"_parent": {
"__id__": 44
"__id__": 45
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 56
"__id__": 57
}
],
"_prefab": null,
......@@ -2360,7 +2392,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 55
"__id__": 56
},
"_enabled": true,
"_materials": [],
......@@ -2388,13 +2420,13 @@
"_name": "light",
"_objFlags": 0,
"_parent": {
"__id__": 44
"__id__": 45
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 58
"__id__": 59
}
],
"_prefab": null,
......@@ -2450,7 +2482,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 57
"__id__": 58
},
"_enabled": true,
"_materials": [],
......@@ -2478,11 +2510,11 @@
"_name": "font",
"_objFlags": 0,
"_parent": {
"__id__": 43
"__id__": 44
},
"_children": [
{
"__id__": 60
"__id__": 61
}
],
"_active": true,
......@@ -2540,13 +2572,13 @@
"_name": "GOTHICB_1",
"_objFlags": 0,
"_parent": {
"__id__": 59
"__id__": 60
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 61
"__id__": 62
}
],
"_prefab": null,
......@@ -2602,7 +2634,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 60
"__id__": 61
},
"_enabled": true,
"_materials": [
......@@ -2637,17 +2669,17 @@
"_name": "audio",
"_objFlags": 0,
"_parent": {
"__id__": 43
"__id__": 44
},
"_children": [
{
"__id__": 63
"__id__": 64
},
{
"__id__": 65
"__id__": 66
},
{
"__id__": 67
"__id__": 68
}
],
"_active": true,
......@@ -2705,13 +2737,13 @@
"_name": "goodjob",
"_objFlags": 0,
"_parent": {
"__id__": 62
"__id__": 63
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 64
"__id__": 65
}
],
"_prefab": null,
......@@ -2767,7 +2799,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 63
"__id__": 64
},
"_enabled": true,
"_clip": {
......@@ -2786,13 +2818,13 @@
"_name": "ready",
"_objFlags": 0,
"_parent": {
"__id__": 62
"__id__": 63
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 66
"__id__": 67
}
],
"_prefab": null,
......@@ -2848,7 +2880,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 65
"__id__": 66
},
"_enabled": true,
"_clip": {
......@@ -2867,13 +2899,13 @@
"_name": "go",
"_objFlags": 0,
"_parent": {
"__id__": 62
"__id__": 63
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 68
"__id__": 69
}
],
"_prefab": null,
......@@ -2929,7 +2961,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 67
"__id__": 68
},
"_enabled": true,
"_clip": {
......@@ -2998,7 +3030,7 @@
"baseWidth": 1280,
"baseHeight": 940,
"videoControlBar": {
"__id__": 14
"__id__": 15
},
"_id": "7akLvWOt5IlbhsZJIcu0P1"
}
......
......@@ -512,7 +512,7 @@ cc.Class({
console.log(" in addServerListener");
const c = window.courseware;
// this.loadEnd();
this.loadEnd();
if (!c) {
return;
}
......@@ -782,10 +782,11 @@ cc.Class({
},
// 设置视频背景
initVideoBg(width, height) {
const maskNode = cc.find('Canvas/video_bg').getComponent(cc.Mask);
maskNode.width = width;
maskNode.height = height;
initVideoBg(width, height, scale) {
console.log("视频尺寸", width, height,scale);
const bgNode = cc.find('Canvas/video_bg')
bgNode.width = width*scale;
bgNode.height = height*scale;
},
getVideoUrl(callback) {
......@@ -1054,22 +1055,24 @@ cc.Class({
console.log(" in initVideoRemote url: ", url);
const videoConfigSize = this.data.videoType.solit('_');
const videoConfigSize = this.data.videoType.split('_');
let videoSizeW = 1920;
let videoSizeH = 1080;
if(videoConfigSize.length ==2 && !isNaN(Number(videoConfigSize[0])) && !isNaN(Number(videoConfigSize[1]))) {
videoSizeW = Number(videoConfigSize[0]);
videoSizeH = Number(videoConfigSize[1]);
}
this.initVideoBg(videoSizeW, videoSizeH);
const scale = this.canvas.height / videoSizeH;
this.initVideoBg(videoSizeW, videoSizeH, scale);
const videoRemoteNode = new cc.Node();
videoRemoteNode.width = videoSizeW;
videoRemoteNode.height = videoSizeH;
videoRemoteNode.parent = this.canvas;
// videoRemoteNode.y = -this.canvas.height * 1.5;
videoRemoteNode.scale = this.canvas.height / videoSizeH;
videoRemoteNode.scale = scale;
const video = videoRemoteNode.addComponent(cc.VideoPlayer);
video.resourceType = cc.VideoPlayer.ResourceType.REMOTE;
......
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