@shijiu/jsview-vue 0.9.359-alpha.0 → 0.9.422
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dom/bin/jsview-browser-debug-dom.min.js +1 -1
- package/dom/bin/jsview-dom.min.js +1 -1
- package/dom/target_core_revision.js +3 -3
- package/loader/jsview.config.default.js +1 -1
- package/loader/jsview.default.config.js +1 -1
- package/loader/loader.js +2 -1
- package/package.json +1 -1
- package/patches/node_modules/@vue/compiler-sfc/dist/jsview-style-format.js +1 -1
- package/patches/node_modules/@vue/runtime-core/dist/runtime-core.esm-bundler.js +20 -7
- package/samples/Basic/App.vue +37 -29
- package/samples/Basic/components/ContentBlock.vue +1 -1
- package/samples/Basic/components/FontStyle.css +6 -0
- package/samples/Basic/components/div/DivBackground.vue +1 -1
- package/samples/Basic/components/div/DivCssScoped.vue +6 -13
- package/samples/Basic/components/div/DivCssVar.vue +3 -7
- package/samples/Basic/components/div/DivGroup2.vue +7 -2
- package/samples/Basic/components/div/DivLayout.vue +3 -3
- package/samples/Basic/components/div/DivTransform.vue +27 -0
- package/samples/Basic/components/img/ImageGroup.vue +31 -0
- package/samples/Basic/components/img/ImgLayout.vue +41 -0
- package/samples/Basic/components/panel/Panel1.vue +53 -0
- package/samples/Basic/components/panel/Panel2.vue +35 -0
- package/samples/Basic/components/panel/TitleBar.vue +29 -0
- package/samples/Basic/components/text/TextEmoji.vue +30 -0
- package/samples/Basic/components/text/{TextGroup.vue → TextGroup1.vue} +0 -0
- package/samples/Basic/components/text/TextGroup2.vue +31 -0
- package/utils/JsViewEngineWidget/JsvFocusBlock.vue +13 -0
- package/utils/JsViewEngineWidget/MetroWidget/ContentView.vue +63 -0
- package/utils/JsViewEngineWidget/MetroWidget/Dispatcher.js +19 -0
- package/utils/JsViewEngineWidget/MetroWidget/DivWrapper.vue +51 -0
- package/utils/JsViewEngineWidget/MetroWidget/ItemView.vue +220 -0
- package/utils/JsViewEngineWidget/MetroWidget/MetroWidget.vue +1860 -0
- package/utils/JsViewEngineWidget/MetroWidget/RootView.vue +153 -0
- package/utils/JsViewEngineWidget/SimpleWidget/SimpleWidget.vue +137 -118
- package/utils/JsViewEngineWidget/TemplateParser.js +212 -158
- package/utils/JsViewEngineWidget/index.js +3 -2
- package/utils/JsViewPlugin/BrowserPluginLoader.js +14 -0
- package/utils/JsViewPlugin/JsvPlayer/JsvMedia.js +502 -108
- package/utils/JsViewPlugin/JsvPlayer/JsvMediaBrowserInterface.js +101 -0
- package/utils/JsViewPlugin/JsvPlayer/JsvPlayer.vue +262 -92
- package/utils/JsViewPlugin/JsvPlayer/JsvPlayerBrowser.vue +40 -0
- package/utils/JsViewPlugin/JsvPlayer/index.js +27 -0
- package/utils/JsViewVueWidget/BrowserDebugWidget/BrowserTextureAnim.vue +1 -2
- package/utils/JsViewVueWidget/JsvMarquee.vue +18 -10
- package/utils/JsViewVueWidget/JsvMaskClipDiv.vue +3 -3
- package/utils/JsViewVueWidget/JsvNinePatch.vue +28 -10
- package/samples/Basic/components/TitleBar.vue +0 -27
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
/* eslint-disable no-unused-vars */
|
|
2
|
+
let methods = {
|
|
3
|
+
/**
|
|
4
|
+
* 要求终端访问指定的频道,并立即返回。对由本地设置为跳过的频道,也返回-1。
|
|
5
|
+
* 频道地址为通过 CTCSetConfig 设置的频道列表中的地址:
|
|
6
|
+
* 如频道地址为 igmp://的组播地址,则加入组播频道,播放器开始播放组播频道,并处理相应的时移等功能;
|
|
7
|
+
* 如频道地址为 rtsp://的单播地址,则连接单播频道,播放器开始播放;
|
|
8
|
+
* 如频道地址为 http://的地址,则浏览器直接发起请求,访问该页面。
|
|
9
|
+
* 【注】:在加入一个频道之前已经加入另外一个频道,需先调用 leaveChannel 方法离开前一个频道。
|
|
10
|
+
* @param {int} channelID 用户频道号。
|
|
11
|
+
* @returns {int} 0,表示成功;-1:表示频道号无效。
|
|
12
|
+
*/
|
|
13
|
+
joinChannel(channelID) {
|
|
14
|
+
console.log(`PC simulate browser player joinChannel(${channelID})`);
|
|
15
|
+
},
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* 要求终端离开指定的频道,并立即返回。
|
|
19
|
+
* 如原频道地址为 igmp://的组播地址,则立即离开组播频道,播放器停止播放组播频道,并断开相应的时移连接;
|
|
20
|
+
* 如频道地址为 rtsp://的单播地址,则断开单播频道,播放器停止播放;
|
|
21
|
+
* 如频道地址为 http://的地址,则浏览器不作操作。
|
|
22
|
+
* 【注】:本方法只用于离开通过 joinChannel 方法加入的频道。
|
|
23
|
+
* @returns {int} 0,表示成功;-1:表示频道号无效。
|
|
24
|
+
*/
|
|
25
|
+
leaveChannel() {
|
|
26
|
+
console.log(`PC simulate browser player leaveChannel()`);
|
|
27
|
+
return 0;
|
|
28
|
+
},
|
|
29
|
+
|
|
30
|
+
// /**
|
|
31
|
+
// * 快进。
|
|
32
|
+
// * @param {float} speed 2至32
|
|
33
|
+
// */
|
|
34
|
+
// fastForward(value) {
|
|
35
|
+
// console.log(`browser player fastForward(${value})`);
|
|
36
|
+
// },
|
|
37
|
+
|
|
38
|
+
// /**
|
|
39
|
+
// * 快退。
|
|
40
|
+
// * @param {float} speed -2至-32
|
|
41
|
+
// */
|
|
42
|
+
// fastRewind(value) {
|
|
43
|
+
// console.log(`browser player fastRewind(${value})`);
|
|
44
|
+
// },
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* 获取系统音量。
|
|
48
|
+
* @param {int} max_volume 音量范围,即可设置的最大音量值,一般有16和100两种值。
|
|
49
|
+
* @return {int} 当前音量,根据max_volume进行了换算。
|
|
50
|
+
* */
|
|
51
|
+
getGlobalVolume(max_volume) {
|
|
52
|
+
console.log(`PC simulate browser player getGlobalVolume(${max_volume})`);
|
|
53
|
+
return 0;
|
|
54
|
+
},
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* 设置系统音量。
|
|
58
|
+
* @param {int} volume 0-max_volume,音量值。
|
|
59
|
+
* @param {int} flags 1表示显示音量调节UI;4表示使用提示音。两个值可以是或的关系。
|
|
60
|
+
* @param {int} max_volume 音量范围,即可设置的最大音量值,一般有16和100两种值。
|
|
61
|
+
* */
|
|
62
|
+
setGlobalVolume(volume, flags, max_volume) {
|
|
63
|
+
console.log(`PC simulate browser player setGlobalVolume(${volume}, ${flags}, ${max_volume})`);
|
|
64
|
+
},
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* 调整系统音量,一次设置一个步长。
|
|
68
|
+
* @param {int} direction 1增大音量;-1减小音量。
|
|
69
|
+
* @param {int} flags FLAG_SHOW_UI(1)表示显示音量调节UI;FLAG_PLAY_SOUND(4)表示使用提示音。两个值可以是或的关系。
|
|
70
|
+
* */
|
|
71
|
+
adjustGlobalVolume(direction, flags) {
|
|
72
|
+
console.log(`PC simulate browser player adjustGlobalVolume(${direction}, ${flags})`);
|
|
73
|
+
},
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* 回到视频的开头。
|
|
77
|
+
*/
|
|
78
|
+
gotoStart() {
|
|
79
|
+
console.log(`PC simulate browser player gotoStart()`);
|
|
80
|
+
},
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* 到达视频的末尾。
|
|
84
|
+
*/
|
|
85
|
+
gotoEnd() {
|
|
86
|
+
console.log(`PC simulate browser player gotoEnd()`);
|
|
87
|
+
},
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* 设置播放地址。
|
|
91
|
+
* @param {string} url 播放地址。
|
|
92
|
+
* @param {string} head 网络请求的head信息,可以为NULL。
|
|
93
|
+
* @param {int} type 类型,1表示点播,2表示直播,3表示时移,默认1。
|
|
94
|
+
*/
|
|
95
|
+
setSrc(url, head, type) {
|
|
96
|
+
console.log(`PC simulate setSrc url=${url} head=${head} type=${type}`);
|
|
97
|
+
this.src = url;
|
|
98
|
+
},
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
export default methods;
|
|
@@ -1,60 +1,185 @@
|
|
|
1
1
|
<script>
|
|
2
|
-
import {
|
|
3
|
-
import { Options, Vue } from "vue-class-component";
|
|
4
|
-
import {JsvMediaVideo} from './JsvMedia'
|
|
2
|
+
import {JsvMediaVideo, findMediaObjectByKey} from './JsvMedia'
|
|
5
3
|
import JsvNativeSharedDiv from 'jsview/utils/JsViewVueWidget/JsvNativeSharedDiv.vue'
|
|
6
4
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
5
|
+
|
|
6
|
+
export default {
|
|
7
|
+
props: {
|
|
8
|
+
/**
|
|
9
|
+
* 回调函数,播放器对象通知接口
|
|
10
|
+
* @param {Object} video对象,可以通过此video对象调用video相关属性和方法,具体属性和方法定义见JsvMedia.js文件里相关说明。
|
|
11
|
+
*/
|
|
12
|
+
onRef: { type: Function, default: () => {} },
|
|
13
|
+
/**
|
|
14
|
+
* 属性,Boolean类型,true表示自动播放,默认false。
|
|
15
|
+
*/
|
|
16
|
+
autoplay: { type: Boolean, default: false },
|
|
17
|
+
/**
|
|
18
|
+
* 属性,String类型,播放器实例索引,同样的key使用同一个播放器实例。
|
|
19
|
+
*/
|
|
20
|
+
playerKey: { type: String, default: null},
|
|
21
|
+
/**
|
|
22
|
+
* 属性,int类型,底层使用的播放器类型。1:系统播放器;2:jsv播放器。默认2。
|
|
23
|
+
*/
|
|
24
|
+
playerType: {type: Number, default: 2},
|
|
25
|
+
/**
|
|
26
|
+
* 属性,Boolean类型,层级关系,true表示在界面的下面,false表示在界面上面,默认true。
|
|
27
|
+
*/
|
|
28
|
+
background: {type: Boolean, default: true},
|
|
29
|
+
/**
|
|
30
|
+
* 属性,Boolean类型,true表示静音,默认false。
|
|
31
|
+
*/
|
|
32
|
+
muted: {type: Boolean, default: false},
|
|
33
|
+
/**
|
|
34
|
+
* 属性,Boolean类型,true表示循环播放,默认false。
|
|
35
|
+
*/
|
|
36
|
+
loop:{type: Boolean, default: false},
|
|
37
|
+
/**
|
|
38
|
+
* 属性,String类型,播放地址。
|
|
39
|
+
*/
|
|
40
|
+
src: {type: String, default: ""},
|
|
41
|
+
/**
|
|
42
|
+
* 属性,Double类型,起播时间,0-duration。
|
|
43
|
+
*/
|
|
44
|
+
currentTime: { type: Number, default: 0},
|
|
45
|
+
/**
|
|
46
|
+
* 属性,Boolean类型,是否保留最后一帧,true保留,false不保留。
|
|
47
|
+
*/
|
|
48
|
+
keepLastFrame: {type: Boolean, default: false},
|
|
49
|
+
/**
|
|
50
|
+
* 回调函数,播放结束时通过此回调接口通知。
|
|
51
|
+
*/
|
|
52
|
+
onEnded: {type: Function, default: ()=>{return{}}},
|
|
53
|
+
/**
|
|
54
|
+
* 回调函数,播放错误时通过此接口通知。
|
|
55
|
+
* @param {int} 错误类型,当前定义了四种错误。1是异常中断;2是网络错误;3是解码错误;4是格式不支持。
|
|
56
|
+
*/
|
|
57
|
+
onError: {type: Function, default: ()=>{return{}}},
|
|
58
|
+
// onAbort: {type: Function, default: ()=>{return{}}},
|
|
59
|
+
/**
|
|
60
|
+
* 回调函数,当正常播放时,每0.5秒上报一次,回调接口里会带上当前时间,也可以使用video对象的currentTime属性去获取当前时间。
|
|
61
|
+
* @param {Long} 当前播放时间,单位秒。
|
|
62
|
+
*/
|
|
63
|
+
onTimeUpdate: {type: Function, default: ()=>{return{}}},
|
|
64
|
+
/**
|
|
65
|
+
* 回调函数,开始加载,设置完播放地址后,上报此事件。
|
|
66
|
+
*/
|
|
67
|
+
onLoadStart: {type: Function, default: ()=>{return{}}},
|
|
68
|
+
/**
|
|
69
|
+
* 回调函数,开始正常播放,同一个播放地址仅触发一次。
|
|
70
|
+
*/
|
|
71
|
+
onCanPlayThrough: {type: Function, default: ()=>{return{}}},
|
|
72
|
+
/**
|
|
73
|
+
* 回调函数,正常下载,duration不变的情况下只触发一次。
|
|
74
|
+
*/
|
|
75
|
+
onProgress: {type: Function, default: ()=>{return{}}},
|
|
76
|
+
/**
|
|
77
|
+
* 回调函数,视频准备好后触发。
|
|
78
|
+
*/
|
|
79
|
+
onLoadedMetaData: {type: Function, default: ()=>{return{}}},
|
|
80
|
+
/**
|
|
81
|
+
* 回调函数,视频准备好后触发,这个时候可以正常seek。
|
|
82
|
+
*/
|
|
83
|
+
onLoad: {type: Function, default: ()=>{return{}}},
|
|
84
|
+
/**
|
|
85
|
+
* 回调函数,视频准备好后触发,这个时候可以获取duration。
|
|
86
|
+
*/
|
|
87
|
+
onDurationChange: {type: Function, default: ()=>{return{}}},
|
|
88
|
+
/**
|
|
89
|
+
* 回调函数,视频准备好后,seek(修改currentTime)会出发此事件。
|
|
90
|
+
*/
|
|
91
|
+
onSeeking: {type: Function, default: ()=>{return{}}},
|
|
92
|
+
/**
|
|
93
|
+
* 回调函数,seek完成后触发此事件。
|
|
94
|
+
*/
|
|
95
|
+
onSeeked: {type: Function, default: ()=>{return{}}},
|
|
96
|
+
/**
|
|
97
|
+
* 回调函数,缓冲时触发。
|
|
98
|
+
*/
|
|
99
|
+
onStalled: {type: Function, default: ()=>{return{}}},
|
|
100
|
+
/**
|
|
101
|
+
* 回调函数,正常播放后触发。
|
|
102
|
+
*/
|
|
103
|
+
onPlaying: {type: Function, default: ()=>{return{}}},
|
|
104
|
+
/**
|
|
105
|
+
* 回调函数,正常显示后触发此事件。
|
|
106
|
+
*/
|
|
107
|
+
onCanPlay: {type: Function, default: ()=>{return{}}},
|
|
108
|
+
/**
|
|
109
|
+
* 回调函数,音频失去焦点后触发此事件,可能会导致pause(点播)或者离开频道(直播)。
|
|
110
|
+
*/
|
|
111
|
+
onAudioFocusLoss: {type: Function, default: ()=>{return{}}},
|
|
112
|
+
/**
|
|
113
|
+
* 回调函数,音频获取焦点后触发此事件,可能会触发resume(点播)或者加入频道(直播)。
|
|
114
|
+
*/
|
|
115
|
+
onAudioFocusGain: {type: Function, default: ()=>{return{}}},
|
|
116
|
+
/**
|
|
117
|
+
* 属性,Object类型,设置窗口属性,同其他组件的style设置。
|
|
118
|
+
*/
|
|
119
|
+
style: {type: Object, default: ()=>{return{}}},
|
|
120
|
+
/**
|
|
121
|
+
* 属性,Boolean类型,活跃状态,当多个JsvPlayer组件指向一个video对象时,只能有一个处于活跃状态。
|
|
122
|
+
* 视频显示在活跃JsvPlayer设置的显示区域内,事件通知也只会送给活跃的JsvPlayer组件注册的回调函数。
|
|
123
|
+
*/
|
|
124
|
+
active:{type: Boolean, default: true},
|
|
125
|
+
},
|
|
126
|
+
components: {
|
|
127
|
+
JsvNativeSharedDiv
|
|
128
|
+
},
|
|
129
|
+
watch: {
|
|
130
|
+
active(newValue) {
|
|
131
|
+
console.log("active newValue: "+newValue);
|
|
132
|
+
if(this.video){
|
|
133
|
+
if(newValue){
|
|
134
|
+
this.registerEvent();
|
|
135
|
+
this.video.setHoleID(this.holeId);
|
|
136
|
+
this.holeStyle = {
|
|
137
|
+
left: 0, top: 0,
|
|
138
|
+
width: this.style.width, height: this.style.height
|
|
139
|
+
};
|
|
140
|
+
}else{
|
|
141
|
+
this.holeStyle = {
|
|
142
|
+
left: 0, top: 0,
|
|
143
|
+
width: 0, height: 0
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
},
|
|
148
|
+
style(newValue){
|
|
149
|
+
console.log("holeStyle newValue: left="+newValue.left+", top="+newValue.top+", width="+newValue.width+", height="+newValue.height);
|
|
150
|
+
if(this.active){
|
|
151
|
+
this.holeStyle = {
|
|
152
|
+
left: 0, top: 0,
|
|
153
|
+
width:newValue.width, height:newValue.height
|
|
154
|
+
};
|
|
155
|
+
}
|
|
156
|
+
},
|
|
157
|
+
keepLastFrame(newValue){
|
|
158
|
+
console.log("keepLastFrame newValue: "+newValue);
|
|
159
|
+
if(this.video && this.active){
|
|
160
|
+
this.video.keepLastFrame = this.keepLastFrame;
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
},
|
|
164
|
+
|
|
165
|
+
setup(){
|
|
166
|
+
return {
|
|
167
|
+
video: null,
|
|
168
|
+
holeId: "",
|
|
169
|
+
};
|
|
170
|
+
},
|
|
171
|
+
|
|
172
|
+
data() {
|
|
173
|
+
return {
|
|
174
|
+
holeStyle: {},
|
|
175
|
+
};
|
|
176
|
+
},
|
|
177
|
+
created() {
|
|
178
|
+
},
|
|
179
|
+
mounted() {
|
|
180
|
+
console.log("JsvPlayer:",this.style)
|
|
56
181
|
|
|
57
|
-
let key = "
|
|
182
|
+
let key = "Jsv_" + Math.floor(Math.random() * 10000);
|
|
58
183
|
if(this.playerKey){
|
|
59
184
|
key = this.playerKey;
|
|
60
185
|
}
|
|
@@ -69,64 +194,109 @@ class JsvPlayer extends Vue {
|
|
|
69
194
|
background = this.background;
|
|
70
195
|
|
|
71
196
|
console.log("JsvPlayer background:"+background)
|
|
72
|
-
//background = false;
|
|
73
197
|
|
|
74
198
|
const designMap = window.Forge.DesignMap();
|
|
75
199
|
console.log("JsvPlayer:", this.holeId)
|
|
76
200
|
|
|
77
|
-
this.video =
|
|
201
|
+
this.video = findMediaObjectByKey(key);
|
|
202
|
+
let first_create = true;
|
|
78
203
|
|
|
204
|
+
if(!this.video){
|
|
205
|
+
this.video = new JsvMediaVideo(this.holeId, player_type, key, background, designMap.width);
|
|
206
|
+
}else{
|
|
207
|
+
this.video.setRef();
|
|
208
|
+
first_create = false;
|
|
209
|
+
}
|
|
79
210
|
|
|
80
211
|
if(this.video != null){
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
this.onRef(this.video);
|
|
212
|
+
if(this.active){
|
|
213
|
+
this.registerEvent();
|
|
214
|
+
|
|
215
|
+
if(first_create){
|
|
216
|
+
if(this.src && this.src !== "")
|
|
217
|
+
this.video.src = this.src;
|
|
218
|
+
|
|
219
|
+
if(this.currenttime !== 0)
|
|
220
|
+
this.video.currentTime = this.currenttime;
|
|
221
|
+
|
|
222
|
+
if(this.autoplay){
|
|
223
|
+
this.video.autoplay = this.autoplay;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
if(this.muted){
|
|
227
|
+
this.video.muted = this.muted;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
if(this.loop){
|
|
231
|
+
this.video.loop = this.loop;
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
if(this.keepLastFrame){
|
|
235
|
+
this.video.keepLastFrame = this.keepLastFrame;
|
|
236
|
+
}
|
|
237
|
+
}else{
|
|
238
|
+
this.video.setHoleID(this.holeId);
|
|
239
|
+
this.holeStyle = {
|
|
240
|
+
left: 0, top: 0,
|
|
241
|
+
width: this.style.width, height: this.style.height
|
|
242
|
+
};
|
|
243
|
+
}
|
|
114
244
|
}
|
|
245
|
+
|
|
246
|
+
this.onRef?.(this.video)
|
|
115
247
|
}
|
|
116
|
-
}
|
|
248
|
+
},
|
|
117
249
|
|
|
118
250
|
unmounted(){
|
|
119
251
|
if(this.video != null){
|
|
120
252
|
this.video.releasePlayer();
|
|
253
|
+
this.onRef?.(null)
|
|
254
|
+
}
|
|
255
|
+
},
|
|
256
|
+
|
|
257
|
+
methods: {
|
|
258
|
+
getHoleId(id){
|
|
259
|
+
console.log("getHoleId:", id)
|
|
260
|
+
this.holeId = id;
|
|
261
|
+
},
|
|
262
|
+
registerEvent(){
|
|
263
|
+
if(this.video && this.active){
|
|
264
|
+
this.video.addEventListener("end", this.onEnded);
|
|
265
|
+
this.video.addEventListener("error", this.onError);
|
|
266
|
+
//this.video.addEventListener("abort", this.onAbort);
|
|
267
|
+
this.video.addEventListener("timeupdate", this.onTimeUpdate);
|
|
268
|
+
this.video.addEventListener("loadstart", () => {
|
|
269
|
+
console.log("JsvPlayer received loadstart event.");
|
|
270
|
+
this.holeStyle = {
|
|
271
|
+
left: 0, top: 0,
|
|
272
|
+
width:this.style.width, height:this.style.height
|
|
273
|
+
};
|
|
274
|
+
this.onLoadStart();
|
|
275
|
+
});
|
|
276
|
+
this.video.addEventListener("canplaythrough", this.onCanPlayThrough);
|
|
277
|
+
this.video.addEventListener("progress", this.onProgress);
|
|
278
|
+
this.video.addEventListener("loadedmetadata", this.onLoadedMetaData);
|
|
279
|
+
this.video.addEventListener("load", this.onLoad);
|
|
280
|
+
this.video.addEventListener("durationchange", this.onDurationChange);
|
|
281
|
+
this.video.addEventListener("seeking", this.onSeeking);
|
|
282
|
+
this.video.addEventListener("seeked", this.onSeeked);
|
|
283
|
+
this.video.addEventListener("stalled", this.onStalled);
|
|
284
|
+
this.video.addEventListener("playing", this.onPlaying);
|
|
285
|
+
this.video.addEventListener("canplay", this.onCanPlay);
|
|
286
|
+
this.video.addEventListener("audiofocusloss", this.onAudioFocusLoss);
|
|
287
|
+
this.video.addEventListener("audiofocusgain", this.onAudioFocusGain);
|
|
288
|
+
}
|
|
121
289
|
}
|
|
122
|
-
}
|
|
290
|
+
},
|
|
123
291
|
}
|
|
124
292
|
|
|
125
|
-
export default JsvPlayer;
|
|
293
|
+
//export default JsvPlayer;
|
|
126
294
|
</script>
|
|
127
295
|
|
|
128
296
|
<template>
|
|
129
|
-
<
|
|
297
|
+
<div :style="style" backgroundColor="rgba(0,0,0,1)">
|
|
298
|
+
<JsvNativeSharedDiv :style="holeStyle" :getId="getHoleId"></JsvNativeSharedDiv>
|
|
299
|
+
</div>
|
|
130
300
|
</template>
|
|
131
301
|
|
|
132
302
|
<style scoped>
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
import playerExMethods from "./JsvMediaBrowserInterface.js"
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
props: {
|
|
6
|
+
onRef: { type: Function, default: () => {} },
|
|
7
|
+
playerKey: { type: String, default: "JsvPlayer"}, // TODO: 尝试通过teleport合并多个video元素
|
|
8
|
+
playerType: {type: Number, default: 1}, // PC 模拟时,不对接本功能
|
|
9
|
+
background: {type: Boolean, default: true}, // PC 模拟时,不对接本功能
|
|
10
|
+
},
|
|
11
|
+
methods: {
|
|
12
|
+
onRefProxy(video_ref) {
|
|
13
|
+
if (video_ref) {
|
|
14
|
+
// 补充插件扩展出来的接口
|
|
15
|
+
for (let method_name in playerExMethods) {
|
|
16
|
+
video_ref[method_name] = playerExMethods[method_name].bind(video_ref);
|
|
17
|
+
}
|
|
18
|
+
} else {
|
|
19
|
+
// video_ref为null,代表video标签卸载处理
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
// 将修改好的video回调返回给使用者
|
|
23
|
+
if (this.onRef) {
|
|
24
|
+
this.onRef(video_ref);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
mounted() {
|
|
29
|
+
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
</script>
|
|
34
|
+
|
|
35
|
+
<template>
|
|
36
|
+
<video :ref="onRefProxy" v-bind="$attrs"/>
|
|
37
|
+
</template>
|
|
38
|
+
|
|
39
|
+
<style scoped>
|
|
40
|
+
</style>
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
//考虑到.vue文件除了export default的component外,还有可能export其他对象,因此使用import * as
|
|
2
|
+
import * as JsvPlayer from "./JsvPlayer.vue";
|
|
3
|
+
import { globalLoadJsvPlayerPlugin as initPlugin } from "./JsvMedia.js"
|
|
4
|
+
import { getJsvPlayerCapabilitySet as getCapabilitySet } from "./JsvMedia.js"
|
|
5
|
+
let _JsvPlayer = JsvPlayer;
|
|
6
|
+
|
|
7
|
+
let globalLoadJsvPlayerPlugin = initPlugin;
|
|
8
|
+
let getJsvPlayerCapabilitySet = getCapabilitySet;
|
|
9
|
+
if (window.JsvWidgetWrapperGroup?.BrowserJsvPlayer) {
|
|
10
|
+
// 浏览器版本
|
|
11
|
+
_JsvPlayer = window.JsvWidgetWrapperGroup.BrowserJsvPlayer;
|
|
12
|
+
|
|
13
|
+
// 为Browser重新定义初始化处理
|
|
14
|
+
globalLoadJsvPlayerPlugin = (listener) => {
|
|
15
|
+
console.log("Loading player plugin");
|
|
16
|
+
setTimeout(()=>{listener()}, 0);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
let component = _JsvPlayer.default;
|
|
21
|
+
|
|
22
|
+
export default component;
|
|
23
|
+
export {
|
|
24
|
+
globalLoadJsvPlayerPlugin, // 全局初始化播放器插件处理
|
|
25
|
+
getJsvPlayerCapabilitySet, //获取设备能力集
|
|
26
|
+
|
|
27
|
+
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @Author: ChenChanghua
|
|
3
3
|
* @Date: 2022-02-08 09:29:17
|
|
4
4
|
* @LastEditors: ChenChanghua
|
|
5
|
-
* @LastEditTime: 2022-
|
|
5
|
+
* @LastEditTime: 2022-03-08 14:08:39
|
|
6
6
|
* @Description: file content
|
|
7
7
|
-->
|
|
8
8
|
<script>
|
|
@@ -55,7 +55,6 @@ export default {
|
|
|
55
55
|
methods: {
|
|
56
56
|
start() {
|
|
57
57
|
if (this.animDiv && this.animation) {
|
|
58
|
-
console.log("cchtest anim set", this.animSet);
|
|
59
58
|
this.animDiv.style.animation = this.animSet;
|
|
60
59
|
}
|
|
61
60
|
},
|
|
@@ -44,7 +44,6 @@ export default {
|
|
|
44
44
|
},
|
|
45
45
|
fontStyles: {
|
|
46
46
|
type: [Array, Object],
|
|
47
|
-
default: () => [sDefaultFontStyle],
|
|
48
47
|
},
|
|
49
48
|
styleToken: String,
|
|
50
49
|
slideSpeed: {
|
|
@@ -56,6 +55,9 @@ export default {
|
|
|
56
55
|
type: Boolean,
|
|
57
56
|
default: false,
|
|
58
57
|
},
|
|
58
|
+
className: {
|
|
59
|
+
type: String,
|
|
60
|
+
},
|
|
59
61
|
},
|
|
60
62
|
data() {
|
|
61
63
|
return {
|
|
@@ -69,6 +71,11 @@ export default {
|
|
|
69
71
|
};
|
|
70
72
|
},
|
|
71
73
|
setup() {},
|
|
74
|
+
computed: {
|
|
75
|
+
_className() {
|
|
76
|
+
return this.FontStyleClass ? this.FontStyleClass : this.className;
|
|
77
|
+
},
|
|
78
|
+
},
|
|
72
79
|
methods: {
|
|
73
80
|
_asyncStartSlider() {
|
|
74
81
|
// 清理之前的Slider处理
|
|
@@ -185,10 +192,10 @@ export default {
|
|
|
185
192
|
this.FontStyleClass = font_set.combinedClass;
|
|
186
193
|
}
|
|
187
194
|
|
|
188
|
-
if (this.FontStyleClass.length === 0) {
|
|
195
|
+
if (this.FontStyleClass && this.FontStyleClass.length === 0) {
|
|
189
196
|
this.FontStyleClass = null;
|
|
190
197
|
}
|
|
191
|
-
this.TokenProcessed = this
|
|
198
|
+
this.TokenProcessed = this.styleToken;
|
|
192
199
|
}
|
|
193
200
|
},
|
|
194
201
|
},
|
|
@@ -210,23 +217,24 @@ export default {
|
|
|
210
217
|
</script>
|
|
211
218
|
|
|
212
219
|
<template>
|
|
213
|
-
<div :style="{ ...
|
|
220
|
+
<div :style="{ ...LayoutStyle, overflow: 'hidden' }">
|
|
214
221
|
<div
|
|
215
222
|
ref="sliderRef"
|
|
216
223
|
:style="{
|
|
217
224
|
left: 0,
|
|
218
225
|
top: 0,
|
|
219
|
-
width:
|
|
220
|
-
height:
|
|
226
|
+
width: LayoutStyle.width,
|
|
227
|
+
height: LayoutStyle.height,
|
|
221
228
|
}"
|
|
222
229
|
>
|
|
223
230
|
<div
|
|
224
231
|
ref="textRef"
|
|
225
|
-
:className="
|
|
226
|
-
:style="{ ...
|
|
227
|
-
:jsv_text_align_minwidth="
|
|
232
|
+
:className="_className"
|
|
233
|
+
:style="{ ...FontStyle, height: LayoutStyle.height }"
|
|
234
|
+
:jsv_text_align_minwidth="LayoutStyle.width"
|
|
235
|
+
jsv-inherit-class="2"
|
|
228
236
|
>
|
|
229
|
-
{{
|
|
237
|
+
{{ text }}
|
|
230
238
|
</div>
|
|
231
239
|
</div>
|
|
232
240
|
</div>
|
|
@@ -97,7 +97,7 @@ export default {
|
|
|
97
97
|
// 注意translate需要px单位,虽然移动的数值单位不是px,但是由于transform只接受px,所以作为workaround加上px
|
|
98
98
|
this.innerView.ResetTextureCssTransform(
|
|
99
99
|
`scale3d(${scale_width},${scale_height},1) ` +
|
|
100
|
-
`translate3d(${move_x}px
|
|
100
|
+
`translate3d(${move_x}px,-${move_y}px,0)`,
|
|
101
101
|
"left top"
|
|
102
102
|
);
|
|
103
103
|
|
|
@@ -154,8 +154,8 @@ export default {
|
|
|
154
154
|
|
|
155
155
|
// 更新描画区域宽高
|
|
156
156
|
this.innerView.ResetLayoutParams({
|
|
157
|
-
width: this.
|
|
158
|
-
height: this.
|
|
157
|
+
width: this.style.width,
|
|
158
|
+
height: this.style.height,
|
|
159
159
|
});
|
|
160
160
|
|
|
161
161
|
// 更新裁剪后的显示子区域
|