首页 > 编程知识 正文

视频工具箱自定义应用,公众号添加自定义菜单

时间:2023-05-05 16:48:07 阅读:157494 作者:3785

ss正文主要实现功能,在视频js的控制栏(controlBar )中添加定制的放大功能

1、主要使用到三个类菜单、菜单、菜单

constmenubutton=video js.get component (menu button ) ) constmenu=videojs.getcomponent ) menu ' ) const menuitem=video jj

2、组装

const items=['100% ',' 80% ',' 50% ',' auto ' ] const my menu=newmenu (this.player ) constmymenuitemlist=[ ] I ) my menuitem list.push (new menuitem (this.player,{ label: items[i] } ) ) mymenuitemlist[I].on ) click

this.player.my menu=my menu this.player.my menuitem list=mymenuitemlistconstmymenubutton=newmenubutton (this.playes ) this.player.my menu button=mymenubuttonthis.player.control bar.addchild (my menu button,{ } ) this.play ()//接收

setshowpercent($event,videoWidth ) { const percent=$event? $ event.target.innertext :视频width 1080? ' 80 % ' : ' auto ' this.show percent.width=percent this.player.my menu button.El (.attributes [0] . owner elect.innerhtml=percent this.player.my menuitem list.foreach (e={ e.toggle class (' vjs-selected ', e.options_.options play () this.player.src (src : this.$ getfilepreviewurl ) this.fileid ),type : this.src

Home | Video.js Documentation

版权声明:该文观点仅代表作者本人。处理文章:请发送邮件至 三1五14八八95#扣扣.com 举报,一经查实,本站将立刻删除。