内容描述
当使用视频组件播放自定义播放地址,出现多余信息小尾巴,参考如下图:
代码内容
var ENUM = {video: 'video', // 视频类型file: 'file', // 文件类型flow: 'flow', // 视频流url: 'url', // 自定义链接hls: 'm3u8',mp4: 'mp4',local: 'local',remoteAddress: 'remoteAddress',localVideo: 'localVideo',module: 'module'};widget._getCurrentList=function() {const { fileData, flowData } = this.options;switch (this.options.videoType) {case ENUM.module:return this.getfileVideo(fileData);case ENUM.file: // 文件视频源return this.getfileVideo(fileData);case ENUM.flow:// 视频流return this.getFlowVideo(flowData);case ENUM.url: { // 自定义链接return new Promise((resolve) => {const tokenName = $('#_csrf_token').attr('name');const tokenKey = $('#_csrf_token').val();const file = this.getFileInfo(this.options.videoUrl);resolve(file ? [{src: `${this.options.videoUrl}`,videoType: file.type,videoSize: '',videoTime: '',videoName: file.name}] : []);});}default:break;}return new Promise((r) => { r([]); });};widget.playFlow = function(param) {if (!param.videoStreaming) {console.info('please config video-path for event-param "videoStreaming"');return;}const isHttpProtocolFlow = this._IsHttpProtocolFlow(param);const isHLSProtocolFlow = this._IsHLSProtocolFlow(param);this.resetVideoContainerHtml();this.createVideo();this.addList();if (isHLSProtocolFlow || isHttpProtocolFlow) {this.setCurrentSource({src: `${param.videoStreaming}`,videoName: '',videoSize: '',videoTime: '',videoType: isHLSProtocolFlow ? ENUM.hls : ENUM.mp4}, true);this.eBind();if (!isHLSProtocolFlow) {this.autoPlay(true);}return;}this.getFlowVideo({httpType: param.protocolType,location: param.videoStreaming,params: []}).then((list) => {const obj = list[0] || {};this.setCurrentSource(obj, true);this.eBind();});}// 修改组件IDwidget.videoInit();
使用说明
1、选择需要播放视频流地址的视频组件;
2、事件->控件初始化->自定义代码
3、将 “代码内容”粘贴到自定义代码内,保存;
4、发布/动态预览 页面,检查视频播放的正确性;
