Commit 713b8585 authored by 李维's avatar 李维

测试视频播放

parent 5fb9f5de
......@@ -109,18 +109,24 @@
},
{
"__id__": 882
},
{
"__id__": 885
},
{
"__id__": 888
}
],
"_active": true,
"_components": [
{
"__id__": 885
"__id__": 896
},
{
"__id__": 886
"__id__": 897
},
{
"__id__": 887
"__id__": 898
}
],
"_prefab": null,
......@@ -34279,6 +34285,498 @@
"_atlas": null,
"_id": "88I6640wlIgrAw8CpkalcL"
},
{
"__type__": "cc.Node",
"_name": "VideoTip",
"_objFlags": 0,
"_parent": {
"__id__": 2
},
"_children": [],
"_active": false,
"_components": [
{
"__id__": 886
},
{
"__id__": 887
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 61,
"height": 66
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
3927.123,
-246.816,
0,
0,
0,
0,
1,
1,
1,
1
]
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "78/uLyko1K76UPnMOey4le"
},
{
"__type__": "cc.Animation",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 885
},
"_enabled": true,
"_defaultClip": {
"__uuid__": "05ef0b95-c80b-4564-843c-1b884ad9b8ee"
},
"_clips": [
{
"__uuid__": "05ef0b95-c80b-4564-843c-1b884ad9b8ee"
}
],
"playOnLoad": true,
"_id": "fdjEq/PdVEdbWnbzJp9nB6"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 885
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "d6e358ee-47e0-44b8-8143-512ad95853ba"
},
"_type": 0,
"_sizeMode": 1,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "d9g0RSeP9FMahO7BdWFuXi"
},
{
"__type__": "cc.Node",
"_name": "VideoPlayerContainer",
"_objFlags": 0,
"_parent": {
"__id__": 2
},
"_children": [
{
"__id__": 889
},
{
"__id__": 891
}
],
"_active": true,
"_components": [
{
"__id__": 895
}
],
"_prefab": null,
"_opacity": 0,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 1920,
"height": 1200
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
0,
0,
0,
0,
0,
1,
1,
1,
1
]
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "08fHPK8g9GF5Md+6I8O5et"
},
{
"__type__": "cc.Node",
"_name": "videoPlayer",
"_objFlags": 0,
"_parent": {
"__id__": 888
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 890
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 0,
"height": 0
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
0,
0,
0,
0,
0,
1,
1,
1,
1
]
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "c5F+73XMlMHLPUcYf1QhoE"
},
{
"__type__": "cc.VideoPlayer",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 889
},
"_enabled": true,
"_resourceType": 0,
"_remoteURL": "",
"_clip": null,
"_volume": 1,
"_mute": false,
"_isFullscreen": false,
"_N$isFullscreen": false,
"_stayOnBottom": false,
"videoPlayerEvent": [],
"_N$keepAspectRatio": true,
"_id": "2dwRPMu0FBT6coCtStcbFS"
},
{
"__type__": "cc.Node",
"_name": "close",
"_objFlags": 0,
"_parent": {
"__id__": 888
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 892
},
{
"__id__": 893
},
{
"__id__": 894
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 80,
"height": 50.4
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
860,
274.8,
0,
0,
0,
0,
1,
1,
1,
1
]
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "e3k1QOkmBC87ZGFEpoU8p8"
},
{
"__type__": "cc.Label",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 891
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_string": "关闭",
"_N$string": "关闭",
"_fontSize": 40,
"_lineHeight": 40,
"_enableWrapText": true,
"_N$file": null,
"_isSystemFontUsed": true,
"_spacingX": 0,
"_batchAsBitmap": false,
"_styleFlags": 0,
"_underlineHeight": 0,
"_N$horizontalAlign": 0,
"_N$verticalAlign": 0,
"_N$fontFamily": "Arial",
"_N$overflow": 0,
"_N$cacheMode": 0,
"_id": "dcRsgxqcZKIJnn4nUYmfXm"
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 891
},
"_enabled": true,
"alignMode": 1,
"_target": {
"__id__": 888
},
"_alignFlags": 33,
"_left": 0,
"_right": 60,
"_top": 300,
"_bottom": 0,
"_verticalCenter": 0,
"_horizontalCenter": 0,
"_isAbsLeft": true,
"_isAbsRight": true,
"_isAbsTop": true,
"_isAbsBottom": true,
"_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true,
"_originalWidth": 0,
"_originalHeight": 0,
"_id": "63zepG2vVHzZoMJKvM0AG8"
},
{
"__type__": "cc.Button",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 891
},
"_enabled": true,
"_normalMaterial": null,
"_grayMaterial": null,
"duration": 0.1,
"zoomScale": 1.2,
"clickEvents": [],
"_N$interactable": true,
"_N$enableAutoGrayEffect": false,
"_N$transition": 0,
"transition": 0,
"_N$normalColor": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_N$pressedColor": {
"__type__": "cc.Color",
"r": 211,
"g": 211,
"b": 211,
"a": 255
},
"pressedColor": {
"__type__": "cc.Color",
"r": 211,
"g": 211,
"b": 211,
"a": 255
},
"_N$hoverColor": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"hoverColor": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_N$disabledColor": {
"__type__": "cc.Color",
"r": 124,
"g": 124,
"b": 124,
"a": 255
},
"_N$normalSprite": null,
"_N$pressedSprite": null,
"pressedSprite": null,
"_N$hoverSprite": null,
"hoverSprite": null,
"_N$disabledSprite": null,
"_N$target": null,
"_id": "972IsZyLFIrLwErhKcIzzN"
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 888
},
"_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": 500,
"_originalHeight": 500,
"_id": "dfRPNRwNRFGaGBxf3FeRXi"
},
{
"__type__": "cc.Canvas",
"_name": "",
......@@ -34343,6 +34841,9 @@
"aniSpeaker": {
"__id__": 882
},
"aniVideoTips": {
"__id__": 885
},
"pronunciationAssessmentModal": {
"__id__": 773
},
......
......@@ -25,6 +25,7 @@ const CROSSWORD_PUZZLE = "9";
const SORT_WORDS = "10";
const CONNECTION_CHOICE = "11";
const TEXTINPUT_GROUP = "12";
const VIDEO_PLAY = "13";
// 评分体系
const RS_15_5L_FAF = "0";
......@@ -56,6 +57,9 @@ export default class SceneComponent extends MyCocosSceneComponent {
@property({type: cc.Node, displayName: "音频播放动画"})
aniSpeaker: cc.Node = null;
@property({type: cc.Node, displayName: "视频提示播放动画"})
aniVideoTips: cc.Node = null;
@property({type: cc.Node, displayName: "语音评测"})
pronunciationAssessmentModal: cc.Node = null;
......@@ -97,6 +101,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
this.initScorePanel();
this.initActionButton();
this.initScoreShow();
this.initVideoPlayerLayer(); // 视频播放层
this.enableScroll(); // 启用页面滚动
this.startTimestamp = new Date().getTime();
}
......@@ -365,6 +370,21 @@ export default class SceneComponent extends MyCocosSceneComponent {
})
}
// 初始化视频播放层
initVideoPlayerLayer() {
const videoPlayer = cc.find("Canvas/VideoPlayerContainer");
const closeBtn = cc.find("close", videoPlayer);
const videoplayer = cc.find("videoPlayer", videoPlayer);
videoplayer.width = videoPlayer.width;
videoplayer.height = videoPlayer.height;
videoPlayer.active = false;
closeBtn.on("click", ()=>{
this.hideVideoLayer();
})
}
scoreShowContainer = null;
initScoreShow() {
const canvas = cc.find("Canvas");
......@@ -534,6 +554,10 @@ export default class SceneComponent extends MyCocosSceneComponent {
case AUDIO_PLAY:
this.setOneAudioBtn(configItem, this.data.hotZoneItemArr[configItem.linkHotZoneIndex]);
break;
// 视频播放按钮
case VIDEO_PLAY:
this.setOneVideoBtn(configItem, this.data.hotZoneItemArr[configItem.linkHotZoneIndex]);
break;
// 热区选项(单选)
case HOT_ZONE_RADIO:
validater = this.setHotZoneRadioGroup(configItem, isDebug);
......@@ -2402,6 +2426,29 @@ export default class SceneComponent extends MyCocosSceneComponent {
})
};
// 视频播放题型
setOneVideoBtn(contentData, hotZoneItemData, debugMode=false) {
const rect = this.newRectNode(hotZoneItemData, layer_4, debugMode);
const aniAudio = cc.instantiate(this.aniVideoTips)
aniAudio.x = 0;
aniAudio.y = 0;
aniAudio.anchorX = aniAudio.anchorY = 0;
aniAudio.active = true;
aniAudio.zIndex = -1;
aniAudio.width = rect.width;
aniAudio.height = rect.height;
rect.addChild(aniAudio);
rect.on("click", async () => {
if(this.submitted) {
return;
}
this.showVideoLayer();
const videoplayer = cc.find("Canvas/VideoPlayerContainer/videoPlayer").getComponent(cc.VideoPlayer)
videoplayer.remoteURL = contentData.video_url;
videoplayer.play();
})
};
// 语音评测题型
setPronunciationAssessment(contentData, hotZoneItemData, debugMode=false) {
let recordUrl = "";
......@@ -2933,6 +2980,32 @@ export default class SceneComponent extends MyCocosSceneComponent {
scorllView.enabled = true;
}
// 显示视频播放页面
showVideoLayer() {
const canvas = cc.find("Canvas");
canvas.children.forEach(nodeItem => {
if(nodeItem.name != "VideoPlayerContainer") {
nodeItem.opacity = 0;
} else {
nodeItem.active = true;
nodeItem.opacity = 255;
}
});
}
// 隐藏视频播放页面
hideVideoLayer() {
const canvas = cc.find("Canvas");
canvas.children.forEach(nodeItem => {
if(nodeItem.name == "VideoPlayerContainer") {
nodeItem.opacity = 0;
nodeItem.active = false;
} else {
nodeItem.opacity = 255;
}
});
}
// 模糊匹配字符串 1,2,3
fuzzyMatchingString(testString, matchString, options){
const {
......
export const defaultData = {"header_image_url":"http://teach.cdn.ireadabc.com/64ef29f4a806e29ecb32fe1db7c98dfb.jpg","footer_image_url":"http://teach.cdn.ireadabc.com/665e4c3e6a80563b4c33dd7bbcd18014.jpg","bgItem":{"url":"http://staging-teach.cdn.ireadabc.com/4425cebcf3aa2eba93f8a485358badf5.jpg","rect":{"x":0,"y":612.1666666666665,"width":1550,"height":3771.666666666667}},"hotZoneItemArr":[{"index":0,"itemType":"rect","itemName":"4-2","fontSize":50,"fontName":"BRLNSR_1","fontColor":"#8f3758","fontScale":1.2109375,"imgScale":1,"mapScale":1.2109375,"rect":{"x":819,"y":1998.83,"width":618,"height":42}},{"index":1,"itemType":"rect","itemName":"4-3","fontSize":50,"fontName":"BRLNSR_1","fontColor":"#8f3758","fontScale":1.2109375,"imgScale":1,"mapScale":1.2109375,"rect":{"x":819,"y":2045.55,"width":618,"height":42}},{"index":2,"itemType":"rect","itemName":"4-4","fontSize":50,"fontName":"BRLNSR_1","fontColor":"#8f3758","fontScale":1.2109375,"imgScale":1,"mapScale":1.2109375,"rect":{"x":819,"y":2092.26,"width":618,"height":42}},{"index":3,"itemType":"rect","itemName":"4-5","fontSize":50,"fontName":"BRLNSR_1","fontColor":"#8f3758","fontScale":1.2109375,"imgScale":1,"mapScale":1.2109375,"rect":{"x":819,"y":2138.98,"width":618,"height":42}},{"index":4,"itemType":"rect","itemName":"4-6","fontSize":50,"fontName":"BRLNSR_1","fontColor":"#8f3758","fontScale":1.2109375,"imgScale":1,"mapScale":1.2109375,"rect":{"x":819,"y":2185.69,"width":618,"height":42}},{"index":5,"itemType":"rect","itemName":"4-7","fontSize":50,"fontName":"BRLNSR_1","fontColor":"#8f3758","fontScale":1.2109375,"imgScale":1,"mapScale":1.2109375,"rect":{"x":819,"y":2232.4,"width":618,"height":42}},{"index":6,"itemType":"rect","itemName":"4-8","fontSize":50,"fontName":"BRLNSR_1","fontColor":"#8f3758","fontScale":1.2109375,"imgScale":1,"mapScale":1.2109375,"rect":{"x":819,"y":2279.12,"width":618,"height":42}},{"index":7,"itemType":"rect","itemName":"4-9","fontSize":50,"fontName":"BRLNSR_1","fontColor":"#8f3758","fontScale":1.2109375,"imgScale":1,"mapScale":1.2109375,"rect":{"x":819,"y":2325.83,"width":618,"height":42}}],"hotZoneConfigArr":[{"hotZoneType":"12","linkHotZoneIndex":-1,"audio_url":"","score":"0","unselectedStyle":"none","selectedStyle":"border","rightOrWrongStyleType":"symbol","inputText":"","keyWordMatch":false,"isCaseInsensitive":true,"openAnswer":false,"useSelectOptionList":false,"keyWordMatchInOrder":false,"capitalizedFirstLetter":false,"notAdaptContraction":false,"selectOptionList":[],"contentList":[{"uuid":"b9480a65-bf53-4fcf-9b27-fb775d2abbe6","text":"","optionShowText":"","image_url":"","hotZoneIndex":null,"score":"1","isCorrect":false,"isCheck":false,"linkedShowText":"","selectStartHotZoneIndex":null,"selectEndHotZoneIndex":null,"selectEndHotZoneShowIndex":null,"selectHotZoneIndex":0,"inputText":"1 | 2 | 3","keyWordMatch":true},{"uuid":"c7c9d9f2-2e0a-43a9-8a80-8def23430e66","text":"","optionShowText":"","image_url":"","hotZoneIndex":null,"score":"1","isCorrect":false,"isCheck":false,"linkedShowText":"","selectStartHotZoneIndex":null,"selectEndHotZoneIndex":null,"selectEndHotZoneShowIndex":null,"inputText":"2","keyWordMatch":false,"keyWordMatchInOrder":false,"isCaseInsensitive":false,"openAnswer":false,"capitalizedFirstLetter":false,"notAdaptContraction":false,"selectHotZoneIndex":1},{"uuid":"79a0666e-ae9b-4c58-a4b5-45d30cab4978","text":"","optionShowText":"","image_url":"","hotZoneIndex":null,"score":"1","isCorrect":false,"isCheck":false,"linkedShowText":"","selectStartHotZoneIndex":null,"selectEndHotZoneIndex":null,"selectEndHotZoneShowIndex":null,"inputText":"3","keyWordMatch":false,"keyWordMatchInOrder":false,"isCaseInsensitive":false,"openAnswer":false,"capitalizedFirstLetter":false,"notAdaptContraction":false,"selectHotZoneIndex":2},{"uuid":"1e4f9710-e7bb-458b-a065-22650c688465","text":"","optionShowText":"","image_url":"","hotZoneIndex":null,"score":"1","isCorrect":false,"isCheck":false,"linkedShowText":"","selectStartHotZoneIndex":null,"selectEndHotZoneIndex":null,"selectEndHotZoneShowIndex":null,"inputText":"4","keyWordMatch":false,"keyWordMatchInOrder":false,"isCaseInsensitive":false,"openAnswer":false,"capitalizedFirstLetter":false,"notAdaptContraction":false,"selectHotZoneIndex":3},{"uuid":"a924e16e-2c8b-4495-b743-450683849529","text":"","optionShowText":"","image_url":"","hotZoneIndex":null,"score":"1","isCorrect":false,"isCheck":false,"linkedShowText":"","selectStartHotZoneIndex":null,"selectEndHotZoneIndex":null,"selectEndHotZoneShowIndex":null,"inputText":"5","keyWordMatch":false,"keyWordMatchInOrder":false,"isCaseInsensitive":false,"openAnswer":false,"capitalizedFirstLetter":false,"notAdaptContraction":false,"selectHotZoneIndex":4},{"uuid":"aff3a858-e189-41a9-86a7-de300326ecd1","text":"","optionShowText":"","image_url":"","hotZoneIndex":null,"score":"1","isCorrect":false,"isCheck":false,"linkedShowText":"","selectStartHotZoneIndex":null,"selectEndHotZoneIndex":null,"selectEndHotZoneShowIndex":null,"inputText":"6","keyWordMatch":false,"keyWordMatchInOrder":false,"isCaseInsensitive":false,"openAnswer":false,"capitalizedFirstLetter":false,"notAdaptContraction":false,"selectHotZoneIndex":5},{"uuid":"1f0dc34e-cf88-47d9-9f53-b9609a390900","text":"","optionShowText":"","image_url":"","hotZoneIndex":null,"score":"1","isCorrect":false,"isCheck":false,"linkedShowText":"","selectStartHotZoneIndex":null,"selectEndHotZoneIndex":null,"selectEndHotZoneShowIndex":null,"inputText":"7","keyWordMatch":false,"keyWordMatchInOrder":false,"isCaseInsensitive":false,"openAnswer":false,"capitalizedFirstLetter":false,"notAdaptContraction":false,"selectHotZoneIndex":6},{"uuid":"a4791aec-2bda-486b-a962-46bebd07641d","text":"","optionShowText":"","image_url":"","hotZoneIndex":null,"score":"1","isCorrect":false,"isCheck":false,"linkedShowText":"","selectStartHotZoneIndex":null,"selectEndHotZoneIndex":null,"selectEndHotZoneShowIndex":null,"inputText":"8","keyWordMatch":false,"keyWordMatchInOrder":false,"isCaseInsensitive":false,"openAnswer":false,"capitalizedFirstLetter":false,"notAdaptContraction":false,"selectHotZoneIndex":7}]}],"scoreConfigArr":[{"linkHotZoneIndex":-1,"linkHotZoneIndexArr":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18]}],"alignMode":"left","ratingSystem":"4","basicScore":"100"}
\ No newline at end of file
export const defaultData = {"header_image_url":"http://teach.cdn.ireadabc.com/64ef29f4a806e29ecb32fe1db7c98dfb.jpg","footer_image_url":"http://teach.cdn.ireadabc.com/665e4c3e6a80563b4c33dd7bbcd18014.jpg","bgItem":{"url":"http://staging-teach.cdn.ireadabc.com/4425cebcf3aa2eba93f8a485358badf5.jpg","rect":{"x":0,"y":612.1666666666665,"width":1550,"height":3771.666666666667}},"hotZoneItemArr":[{"index":0,"itemType":"rect","itemName":"4-2","fontSize":50,"fontName":"BRLNSR_1","fontColor":"#8f3758","fontScale":1.2109375,"imgScale":1,"mapScale":1.2109375,"rect":{"x":819,"y":1998.83,"width":618,"height":42}},{"index":1,"itemType":"rect","itemName":"4-3","fontSize":50,"fontName":"BRLNSR_1","fontColor":"#8f3758","fontScale":1.2109375,"imgScale":1,"mapScale":1.2109375,"rect":{"x":819,"y":2045.55,"width":618,"height":42}},{"index":2,"itemType":"rect","itemName":"4-4","fontSize":50,"fontName":"BRLNSR_1","fontColor":"#8f3758","fontScale":1.2109375,"imgScale":1,"mapScale":1.2109375,"rect":{"x":819,"y":2092.26,"width":618,"height":42}},{"index":3,"itemType":"rect","itemName":"4-5","fontSize":50,"fontName":"BRLNSR_1","fontColor":"#8f3758","fontScale":1.2109375,"imgScale":1,"mapScale":1.2109375,"rect":{"x":819,"y":2138.98,"width":618,"height":42}},{"index":4,"itemType":"rect","itemName":"4-6","fontSize":50,"fontName":"BRLNSR_1","fontColor":"#8f3758","fontScale":1.2109375,"imgScale":1,"mapScale":1.2109375,"rect":{"x":819,"y":2185.69,"width":618,"height":42}},{"index":5,"itemType":"rect","itemName":"4-7","fontSize":50,"fontName":"BRLNSR_1","fontColor":"#8f3758","fontScale":1.2109375,"imgScale":1,"mapScale":1.2109375,"rect":{"x":819,"y":2232.4,"width":618,"height":42}},{"index":6,"itemType":"rect","itemName":"4-8","fontSize":50,"fontName":"BRLNSR_1","fontColor":"#8f3758","fontScale":1.2109375,"imgScale":1,"mapScale":1.2109375,"rect":{"x":819,"y":2279.12,"width":618,"height":42}},{"index":7,"itemType":"rect","itemName":"4-9","fontSize":50,"fontName":"BRLNSR_1","fontColor":"#8f3758","fontScale":1.2109375,"imgScale":1,"mapScale":1.2109375,"rect":{"x":819,"y":2325.83,"width":618,"height":42}},{"index":8,"itemType":"rect","itemName":"test-video","fontSize":50,"fontName":"BRLNSR_1","fontColor":"#8f3758","fontScale":1.2109375,"imgScale":1,"mapScale":1.2109375,"rect":{"x":262,"y":1844.83,"width":46,"height":46}}],"hotZoneConfigArr":[{"hotZoneType":"12","linkHotZoneIndex":-1,"audio_url":"","score":"0","unselectedStyle":"none","selectedStyle":"border","rightOrWrongStyleType":"symbol","inputText":"","keyWordMatch":false,"isCaseInsensitive":true,"openAnswer":false,"useSelectOptionList":false,"keyWordMatchInOrder":false,"capitalizedFirstLetter":false,"notAdaptContraction":false,"selectOptionList":[],"contentList":[{"uuid":"b9480a65-bf53-4fcf-9b27-fb775d2abbe6","text":"","optionShowText":"","image_url":"","hotZoneIndex":null,"score":"1","isCorrect":false,"isCheck":false,"linkedShowText":"","selectStartHotZoneIndex":null,"selectEndHotZoneIndex":null,"selectEndHotZoneShowIndex":null,"selectHotZoneIndex":0,"inputText":"1 | 2 | 3","keyWordMatch":true},{"uuid":"c7c9d9f2-2e0a-43a9-8a80-8def23430e66","text":"","optionShowText":"","image_url":"","hotZoneIndex":null,"score":"1","isCorrect":false,"isCheck":false,"linkedShowText":"","selectStartHotZoneIndex":null,"selectEndHotZoneIndex":null,"selectEndHotZoneShowIndex":null,"inputText":"2","keyWordMatch":false,"keyWordMatchInOrder":false,"isCaseInsensitive":false,"openAnswer":false,"capitalizedFirstLetter":false,"notAdaptContraction":false,"selectHotZoneIndex":1},{"uuid":"79a0666e-ae9b-4c58-a4b5-45d30cab4978","text":"","optionShowText":"","image_url":"","hotZoneIndex":null,"score":"1","isCorrect":false,"isCheck":false,"linkedShowText":"","selectStartHotZoneIndex":null,"selectEndHotZoneIndex":null,"selectEndHotZoneShowIndex":null,"inputText":"3","keyWordMatch":false,"keyWordMatchInOrder":false,"isCaseInsensitive":false,"openAnswer":false,"capitalizedFirstLetter":false,"notAdaptContraction":false,"selectHotZoneIndex":2},{"uuid":"1e4f9710-e7bb-458b-a065-22650c688465","text":"","optionShowText":"","image_url":"","hotZoneIndex":null,"score":"1","isCorrect":false,"isCheck":false,"linkedShowText":"","selectStartHotZoneIndex":null,"selectEndHotZoneIndex":null,"selectEndHotZoneShowIndex":null,"inputText":"4","keyWordMatch":false,"keyWordMatchInOrder":false,"isCaseInsensitive":false,"openAnswer":false,"capitalizedFirstLetter":false,"notAdaptContraction":false,"selectHotZoneIndex":3},{"uuid":"a924e16e-2c8b-4495-b743-450683849529","text":"","optionShowText":"","image_url":"","hotZoneIndex":null,"score":"1","isCorrect":false,"isCheck":false,"linkedShowText":"","selectStartHotZoneIndex":null,"selectEndHotZoneIndex":null,"selectEndHotZoneShowIndex":null,"inputText":"5","keyWordMatch":false,"keyWordMatchInOrder":false,"isCaseInsensitive":false,"openAnswer":false,"capitalizedFirstLetter":false,"notAdaptContraction":false,"selectHotZoneIndex":4},{"uuid":"aff3a858-e189-41a9-86a7-de300326ecd1","text":"","optionShowText":"","image_url":"","hotZoneIndex":null,"score":"1","isCorrect":false,"isCheck":false,"linkedShowText":"","selectStartHotZoneIndex":null,"selectEndHotZoneIndex":null,"selectEndHotZoneShowIndex":null,"inputText":"6","keyWordMatch":false,"keyWordMatchInOrder":false,"isCaseInsensitive":false,"openAnswer":false,"capitalizedFirstLetter":false,"notAdaptContraction":false,"selectHotZoneIndex":5},{"uuid":"1f0dc34e-cf88-47d9-9f53-b9609a390900","text":"","optionShowText":"","image_url":"","hotZoneIndex":null,"score":"1","isCorrect":false,"isCheck":false,"linkedShowText":"","selectStartHotZoneIndex":null,"selectEndHotZoneIndex":null,"selectEndHotZoneShowIndex":null,"inputText":"7","keyWordMatch":false,"keyWordMatchInOrder":false,"isCaseInsensitive":false,"openAnswer":false,"capitalizedFirstLetter":false,"notAdaptContraction":false,"selectHotZoneIndex":6},{"uuid":"a4791aec-2bda-486b-a962-46bebd07641d","text":"","optionShowText":"","image_url":"","hotZoneIndex":null,"score":"1","isCorrect":false,"isCheck":false,"linkedShowText":"","selectStartHotZoneIndex":null,"selectEndHotZoneIndex":null,"selectEndHotZoneShowIndex":null,"inputText":"8","keyWordMatch":false,"keyWordMatchInOrder":false,"isCaseInsensitive":false,"openAnswer":false,"capitalizedFirstLetter":false,"notAdaptContraction":false,"selectHotZoneIndex":7}]},{"hotZoneType":"13","linkHotZoneIndex":8,"audio_url":"","video_url":"http://staging-teach.cdn.ireadabc.com/2ef06de470293f307b60513e1275b27a.mp4","score":"0","unselectedStyle":"none","selectedStyle":"border","rightOrWrongStyleType":"symbol","inputText":"","keyWordMatch":false,"isCaseInsensitive":false,"openAnswer":false,"useSelectOptionList":false,"keyWordMatchInOrder":false,"capitalizedFirstLetter":false,"notAdaptContraction":false,"selectOptionList":[],"contentList":[]}],"scoreConfigArr":[{"linkHotZoneIndex":-1,"linkHotZoneIndexArr":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18]}],"alignMode":"left","ratingSystem":"4","basicScore":"30"}
\ No newline at end of file
......@@ -518,3 +518,22 @@ export function getUUID() {
});
}
// 获取视频地址
// export function getVideoUrl(callback) {
// const url1 = this.data.video_url;
// // 强制使用原视频
// // console.log("强制使用原视频")
// // callback(url1);
// // return
// // ==== End ===
// const url2 = url1.replace(/.mp4$/g, "_h.mp4");
// this.httpHeadCall(url2, (success) => {
// if (success) {
// console.log('return url2: ', url2);
// callback(url2);
// } else {
// console.log('return url1: ', url1);
// callback(url1);
// }
// })
// }
{
"ver": "2.3.5",
"uuid": "cf3bbd02-e243-4c25-bcbe-31194ea30f54",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 70,
"height": 70,
"platformSettings": {},
"subMetas": {
"video_0": {
"ver": "1.0.4",
"uuid": "d6e358ee-47e0-44b8-8143-512ad95853ba",
"rawTextureUuid": "cf3bbd02-e243-4c25-bcbe-31194ea30f54",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0.5,
"offsetY": 0,
"trimX": 5,
"trimY": 2,
"width": 61,
"height": 66,
"rawWidth": 70,
"rawHeight": 70,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "e1ab8777-3621-4444-9321-258e7ec5780a",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 70,
"height": 70,
"platformSettings": {},
"subMetas": {
"video_1": {
"ver": "1.0.4",
"uuid": "183d0c6e-42ae-42e0-9d29-4464519e5a1e",
"rawTextureUuid": "e1ab8777-3621-4444-9321-258e7ec5780a",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0.5,
"offsetY": 0,
"trimX": 5,
"trimY": 2,
"width": 61,
"height": 66,
"rawWidth": 70,
"rawHeight": 70,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"__type__": "cc.AnimationClip",
"_name": "videoTip",
"_objFlags": 0,
"_native": "",
"_duration": 1.0166666666666666,
"sample": 60,
"speed": 1,
"wrapMode": 2,
"curveData": {
"comps": {
"cc.Sprite": {
"spriteFrame": [
{
"frame": 0,
"value": {
"__uuid__": "d6e358ee-47e0-44b8-8143-512ad95853ba"
}
},
{
"frame": 0.5,
"value": {
"__uuid__": "183d0c6e-42ae-42e0-9d29-4464519e5a1e"
}
},
{
"frame": 1,
"value": {
"__uuid__": "d6e358ee-47e0-44b8-8143-512ad95853ba"
}
}
]
}
}
},
"events": []
}
\ No newline at end of file
{
"ver": "2.1.0",
"uuid": "05ef0b95-c80b-4564-843c-1b884ad9b8ee",
"subMetas": {}
}
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
<div class="p-video-box">
<div class="up-video" style="display: flex;">
<!--<nz-upload class="" [nzDisabled]="!showUploadBtn"-->
<!--[nzShowUploadList]="false"-->
<!--[nzBeforeUpload]="beforeUpload"-->
<!--nzAccept = ".mp4"-->
<!--style="margin-right: 1rem">-->
<nz-upload class="p-image-uploader" [nzDisabled]="uploading"
[nzShowUploadList]="false"
nzAccept = ".mp4"
[nzAction]="uploadUrl"
[nzData]="uploadData"
(nzChange)="handleChange($event)"
style="margin-right: 1rem">
<button type="button" nz-button nzType="default" *ngIf="showUploadBtn" [disabled]="uploading"
[nzLoading]="uploading" >
<i nz-icon nzType="plus" nzTheme="outline"></i>
<span>{{ uploading ? 'Uploading' : 'Select Video' }}</span>
<!--<span>Select Video</span>-->
</button>
</nz-upload>
<!--<button nz-button nzType="primary" *ngIf="showUploadBtn"-->
<!--style="margin-right: 1rem"-->
<!--type="button"-->
<!--[nzLoading]="uploading"-->
<!--(click)="handleUpload()"-->
<!--[disabled]="!videoFile || uploading">-->
<!--<i nz-icon type="upload" theme="outline"></i>-->
<!--<span>{{ uploading ? 'Uploading' : 'Start Upload' }}</span>-->
<!--</button>-->
<!--
<button type="button"
(click)="extraCover()"
nz-button nzType="default"
[disabled]=" !(videoUrl && videoUrl.constructor.name === 'String')">设置封面</button>
-->
<!--
<nz-divider></nz-divider>
<div [style.display]="!uploading?'none':''" style="position:relative">
<div style="width: calc( 100% - 20px);">
<nz-progress [nzPercent]="progress">
</nz-progress>
<div class="up-video" style="display: flex;">
<!--<nz-upload class="" [nzDisabled]="!showUploadBtn"-->
<!--[nzShowUploadList]="false"-->
<!--[nzBeforeUpload]="beforeUpload"-->
<!--nzAccept = ".mp4"-->
<!--style="margin-right: 1rem">-->
<nz-upload class="p-image-uploader" [nzDisabled]="uploading"
[nzShowUploadList]="false"
nzAccept = ".mp4"
[nzAction]="uploadUrl"
[nzData]="uploadData"
(nzChange)="handleChange($event)"
style="margin-right: 1rem">
<button type="button" nz-button nzType="default" *ngIf="showUploadBtn" [disabled]="uploading"
[nzLoading]="uploading" >
<i nz-icon nzType="plus" nzTheme="outline"></i>
<span>{{ uploading ? 'Uploading' : 'Select Video' }}</span>
<!--<span>Select Video</span>-->
</button>
</nz-upload>
<!--<button nz-button nzType="primary" *ngIf="showUploadBtn"-->
<!--style="margin-right: 1rem"-->
<!--type="button"-->
<!--[nzLoading]="uploading"-->
<!--(click)="handleUpload()"-->
<!--[disabled]="!videoFile || uploading">-->
<!--<i nz-icon type="upload" theme="outline"></i>-->
<!--<span>{{ uploading ? 'Uploading' : 'Start Upload' }}</span>-->
<!--</button>-->
<!--
<button type="button"
(click)="extraCover()"
nz-button nzType="default"
[disabled]=" !(videoUrl && videoUrl.constructor.name === 'String')">设置封面</button>
-->
<!--
<nz-divider></nz-divider>
<div [style.display]="!uploading?'none':''" style="position:relative">
<div style="width: calc( 100% - 20px);">
<nz-progress [nzPercent]="progress">
</nz-progress>
</div>
<i (click)="cancelUpload()" class="anticon anticon-close-circle" style="position: absolute;top: 50%;right: 0;transform: translateY(-50%);cursor: pointer"></i>
</div>
<i (click)="cancelUpload()" class="anticon anticon-close-circle" style="position: absolute;top: 50%;right: 0;transform: translateY(-50%);cursor: pointer"></i>
</div>
-->
</div>
<div class="p-box d-flex align-items-center p-video-uploader">
<div class="p-upload-icon" *ngIf="!showUploadBtn && !videoUrl && !uploading">
<i nz-icon nzType="upload" nzTheme="outline"></i>
<div class="m-3"></div>
<span>Click here to upload video</span>
<div class="mt-5 p-progress-bar" *ngIf="uploading">
<div class="p-progress-bg" [style.width]="progress*0.2+'rem'"></div>
<div class="p-progress-value">{{progress}}%</div>
</div>
-->
</div>
<div class="p-upload-progress-bg dddd " *ngIf="uploading"
[ngClass]="{'smart-bar': showUploadBtn}" >
<div class="i-bg" [style.width]="progress+'%'"></div>
<div class="i-text">
<fa-icon icon="cloud-upload-alt"></fa-icon>
Uploading...
<div class="p-box d-flex align-items-center p-video-uploader">
<div class="p-upload-icon" *ngIf="!showUploadBtn && !videoUrl && !uploading">
<i nz-icon nzType="upload" nzTheme="outline"></i>
<div class="m-3"></div>
<span>Click here to upload video</span>
<div class="mt-5 p-progress-bar" *ngIf="uploading">
<div class="p-progress-bg" [style.width]="progress*0.2+'rem'"></div>
<div class="p-progress-value">{{progress}}%</div>
</div>
</div>
</div>
<div class="p-upload-check-bg" *ngIf="checking">
<div class="i-bg" [style.width]="progress+'%'"></div>
<div class="i-text">
<fa-icon icon="cloud-upload-alt"></fa-icon>
<i nz-icon nzType="loading" nzTheme="outline"></i>Checking...
<div class="p-upload-progress-bg dddd " *ngIf="uploading"
[ngClass]="{'smart-bar': showUploadBtn}" >
<div class="i-bg" [style.width]="progress+'%'"></div>
<div class="i-text">
<fa-icon icon="cloud-upload-alt"></fa-icon>
Uploading...
</div>
</div>
<div class="p-upload-check-bg" *ngIf="checking">
<div class="i-bg" [style.width]="progress+'%'"></div>
<div class="i-text">
<fa-icon icon="cloud-upload-alt"></fa-icon>
<i nz-icon nzType="loading" nzTheme="outline"></i>Checking...
</div>
</div>
<div class="p-preview" *ngIf="!uploading && videoUrl " >
<!--<video crossorigin="anonymous" [src]="videoUrl" controls #videoNode></video>-->
<video [src]="safeVideoUrl(videoUrl)" controls #videoNode></video>
</div>
</div>
<div [style.display]="!checkVideoExists?'none':''">
<span><i nz-icon nzType="loading" nzTheme="outline"></i> checking file to upload</span>
</div>
<div class="p-preview" *ngIf="!uploading && videoUrl " >
<video crossorigin="anonymous" [src]="videoUrl" controls #videoNode></video>
<!-- <video [src]="safeVideoUrl(videoUrl)" controls #videoNode></video> -->
</div>
</div>
<div [style.display]="!checkVideoExists?'none':''">
<span><i nz-icon nzType="loading" nzTheme="outline"></i> checking file to upload</span>
</div>
</div>
\ No newline at end of file
......@@ -19,9 +19,8 @@
.p-video-uploader {
position: relative;
display: block;
width: 100%;
height: 0;
padding-bottom: 56.25%;
height: 200px;
.p-box {
position: absolute;
left: 0;
......
......@@ -59,10 +59,10 @@ export class UploadVideoComponent implements OnChanges, OnDestroy {
this.videoFile = null;
this.uploadUrl = (<any> window).courseware.uploadUrl();
this.uploadUrl = (<any> window).courseware.uploadVideoUrl();
this.uploadData = (<any> window).courseware.uploadData();
window['air'].getUploadCallback = (url, data) => {
window['air'].getUploadVideoCallback = (url, data) => {
this.uploadUrl = url;
this.uploadData = data;
......@@ -81,8 +81,8 @@ export class UploadVideoComponent implements OnChanges, OnDestroy {
}
safeVideoUrl(url) {
console.log(url);
return this.sanitization.bypassSecurityTrustResourceUrl(url); // `${url}`;
// console.log(this.sanitization.bypassSecurityTrustResourceUrl(url));
return this.sanitization.bypassSecurityTrustResourceUrl(url)['changingThisBreaksApplicationSecurity']; // `${url}`;
}
videoLoadedMetaData() {
......
......@@ -54,6 +54,7 @@
<nz-select [(ngModel)]="it.hotZoneType" style="width: 300px;" (ngModelChange)="save()">
<nz-option [nzValue]="TEXT_SELECT" nzLabel="文字选项"></nz-option>
<nz-option [nzValue]="AUDIO_PLAY" nzLabel="播放音频"></nz-option>
<nz-option [nzValue]="VIDEO_PLAY" nzLabel="播放视频"></nz-option>
<nz-option [nzValue]="HOT_ZONE_RADIO" nzLabel="热区选项(单选)"></nz-option>
<nz-option [nzValue]="HOT_ZONE_CHECKBOX" nzLabel="热区选项(多选)"></nz-option>
<nz-option [nzValue]="TEXTINPUT" nzLabel="文字输入"></nz-option>
......@@ -108,7 +109,7 @@
</nz-table>
</div>
<div *ngIf="it.hotZoneType != '' && it.hotZoneType != AUDIO_PLAY && it.hotZoneType != TEXTINPUT && it.hotZoneType != PRONUNCIATION_ASSESSMENT" style="padding: 10px 0 10px 150px;">
<div *ngIf="it.hotZoneType != '' && it.hotZoneType != AUDIO_PLAY && it.hotZoneType != VIDEO_PLAY && it.hotZoneType != TEXTINPUT && it.hotZoneType != PRONUNCIATION_ASSESSMENT" style="padding: 10px 0 10px 150px;">
<div style="margin-bottom: 16px;">
<span style="font-size: 14px; color: #000000d9;">内容清单</span>
<button nz-button nzSize="small" nzType="primary" style="float: right;" (click)="addHotZoneConfigItem(it)">
......@@ -460,14 +461,19 @@
</tr>
</tbody>
</nz-table>
</div>
<div *ngIf="it.hotZoneType == AUDIO_PLAY" style="padding: 20px 0 10px 150px;">
<app-audio-recorder
[audioUrl]="it.audio_url"
(audioUploaded)="onAudioUploadSuccess($event, 'audio_url', it)"
></app-audio-recorder>
</div>
<div *ngIf="it.hotZoneType == VIDEO_PLAY" style="padding: 20px 0 10px 150px;">
<app-upload-video [videoUrl]="it.video_url" (videoUploaded)="onVideoUploadSuccess($event, 'video_url', it)"></app-upload-video>
</div>
</div>
<div *ngIf="it.hotZoneType == HOT_ZONE_RADIO || it.hotZoneType == HOT_ZONE_CHECKBOX" style="margin: 10px 10px;">
......@@ -529,7 +535,7 @@
</nz-select>
</div>
<div *ngIf="it.hotZoneType != ''&& it.hotZoneType != AUDIO_PLAY && it.hotZoneType != HOT_ZONE_CHECKBOX && it.hotZoneType != CONNECTION && it.hotZoneType != TEXT_SELECT && it.hotZoneType != RIGHT_OR_WRONG && it.hotZoneType != TEXTINPUT_GROUP" style="margin: 10px 10px;">
<div *ngIf="it.hotZoneType != ''&& it.hotZoneType != AUDIO_PLAY && it.hotZoneType != VIDEO_PLAY && it.hotZoneType != HOT_ZONE_CHECKBOX && it.hotZoneType != CONNECTION && it.hotZoneType != TEXT_SELECT && it.hotZoneType != RIGHT_OR_WRONG && it.hotZoneType != TEXTINPUT_GROUP" style="margin: 10px 10px;">
<span style="display: inline-block; text-align: right; width: 150px;">分数:</span>
<input type="text" nz-input [(ngModel)]="it.score" (blur)="save()" style="display: inline-block; width: 300px;">
</div>
......
......@@ -55,6 +55,7 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy, AfterViewIni
SORT_WORDS = "10";
CONNECTION_CHOICE = "11";
TEXTINPUT_GROUP = "12";
VIDEO_PLAY = "13";
// 评分体系
RS_15_5L_FAF = "0";
......@@ -126,6 +127,7 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy, AfterViewIni
hotZoneType: "",
linkHotZoneIndex: -1,
audio_url: "",
video_url: "",
score: "0",
unselectedStyle: "none",
selectedStyle: "border",
......@@ -552,7 +554,7 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy, AfterViewIni
totalScore = parseFloat(_totalScore + "");
this.item.hotZoneConfigArr.forEach((content, contentIndex) => {
if(content.hotZoneType != this.AUDIO_PLAY) {
if(content.hotZoneType != this.AUDIO_PLAY && content.hotZoneType != this.VIDEO_PLAY) {
if(allScoreIndex.indexOf(contentIndex) == -1) {
scoreConfigErr.push((`内容${contentIndex+1}: 没有被配置到题目内容中,请检查分数配置`))
}
......@@ -626,11 +628,11 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy, AfterViewIni
this.save();
}
onVideoUploadSuccess(e, item=null) {
onVideoUploadSuccess(e, key, item=null) {
if (!item) {
item = this.item;
}
item.video_url = e.url;
item[key] = e.url;
this.save();
}
......
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