在extjs中从给定的url播放视频非常简单:
Ext.application({
name : 'Fiddle',
launch : function() {
Ext.create('Ext.panel.Panel', {
renderTo: Ext.getBody(),
itemId: 'foo',
html: '<iframe width="300" height="200" src="//content.jwplatform.com/videos/HkauGhRi-640.mp4" frameborder="0" allowfullscreen></iframe>',
});
}
});
但是,使用filefield
可热播放(预览)本地视频文件
发布于 2021-01-26 21:04:11
最新的工具包:https://docs.sencha.com/extjs/7.3.1/modern/Ext.Video.html
Ext.create({
xtype: 'panel',
renderTo: Ext.getBody(),
width: 800,
height: 600,
shadow: true,
scrollable: true,
title: 'My Video Panel',
layout: 'hbox',
items: [{
xtype: 'video',
onVideoplayerid0Play: function (media, eOpts) {
var video = Ext.get(media.id).select('video:first-of-type ', true).elements[0];
if (video.style.display == 'none') {
video.style.display = '';
}
},
url: 'https://www.learningcontainer.com/wp-content/uploads/2020/05/sample-mp4-file.mp4',
listeners: {
painted: function (video) {
video.play();
},
play: function(video) {
// BUG fix. on auto play the black display is not disappeared.
document.getElementsByClassName('x-video-ghost')[0].style.display = 'none';
}
}
}]
});
https://stackoverflow.com/questions/65865914
复制相似问题