添加设置控制器

This commit is contained in:
Harvey Zack committed 2018-11-02 15:04:16 +08:00
1 parent 711cf5684a
commit 9eab1ed6c0
24 files changed
+297 -119

No files matched your search

+4 -3
View File
@@ -5,9 +5,10 @@
.artplayer-video-player .artplayer-danmu{position:absolute;z-index:30;left:0;top:0;right:0;bottom:0;width:100%;height:100%}
.artplayer-video-player .artplayer-mask{display:none;position:absolute;z-index:50;left:0;top:0;right:0;bottom:0;width:100%;height:100%;cursor:pointer}.artplayer-video-player .artplayer-mask .art-icon-playBig{position:absolute;right:30px;bottom:65px;opacity:.6}
.artplayer-video-player .artplayer-loading{display:none;position:absolute;z-index:70;left:0;top:0;right:0;bottom:0;width:100%;height:100%;align-items:center;justify-content:center}
.artplayer-video-player .artplayer-bottom{position:absolute;z-index:60;left:0;right:0;bottom:0;height:100px;padding:60px 10px 0;opacity:0;visibility:hidden;transition:all .2s ease-in-out;pointer-events:none;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAADGCAYAAAAT+OqFAAAAdklEQVQoz42QQQ7AIAgEF/T/D+kbq/RWAlnQyyazA4aoAB4FsBSA/bFjuF1EOL7VbrIrBuusmrt4ZZORfb6ehbWdnRHEIiITaEUKa5EJqUakRSaEYBJSCY2dEstQY7AuxahwXFrvZmWl2rh4JZ07z9dLtesfNj5q0FU3A5ObbwAAAABJRU5ErkJggg==) repeat-x bottom}.artplayer-video-player .artplayer-bottom .artplayer-progress{position:relative;pointer-events:all}.artplayer-video-player .artplayer-bottom .artplayer-progress .art-control-progress{position:relative;height:5px;padding:1px 0;cursor:pointer}.artplayer-video-player .artplayer-bottom .artplayer-progress .art-control-progress .art-control-progress-inner{position:relative;height:100%;background:hsla(0,0%,100%,.2)}.artplayer-video-player .artplayer-bottom .artplayer-progress .art-control-progress .art-control-progress-inner .art-progress-loaded{position:absolute;z-index:10;left:0;top:0;right:0;bottom:0;height:100%;width:0;background:hsla(0,0%,100%,.4)}.artplayer-video-player .artplayer-bottom .artplayer-progress .art-control-progress .art-control-progress-inner .art-progress-played{position:absolute;z-index:20;left:0;top:0;right:0;bottom:0;height:100%;width:0}.artplayer-video-player .artplayer-bottom .artplayer-progress .art-control-progress .art-control-progress-inner .art-progress-highlight{position:absolute;z-index:30;left:0;top:0;right:0;bottom:0;height:0}.artplayer-video-player .artplayer-bottom .artplayer-progress .art-control-progress .art-control-progress-inner .art-progress-highlight span{display:inline-block;position:absolute;left:0;top:0;width:7px;height:3px;background:#fff;border-radius:3px}.artplayer-video-player .artplayer-bottom .artplayer-progress .art-control-progress .art-control-progress-inner .art-progress-indicator{display:none;position:absolute;z-index:40;top:-5px;left:-6.5px;width:13px;height:13px;border-radius:50%}.artplayer-video-player .artplayer-bottom .artplayer-progress .art-control-progress .art-control-progress-inner .art-progress-indicator.show-indicator{display:block}.artplayer-video-player .artplayer-bottom .artplayer-progress .art-control-progress .art-control-progress-inner .art-progress-tip{display:none;position:absolute;z-index:50;top:-25px;left:0;height:20px;padding:0 5px;line-height:20px;color:#fff;font-size:12px;text-align:center;background:rgba(0,0,0,.7);border-radius:3px;font-weight:700}.artplayer-video-player .artplayer-bottom .artplayer-progress .art-control-progress:hover .art-progress-indicator,.artplayer-video-player .artplayer-bottom .artplayer-progress .art-control-progress:hover .art-progress-tip{display:block}.artplayer-video-player .artplayer-bottom .artplayer-progress .art-control-thumbnails{display:none;position:absolute;bottom:8px;left:0;pointer-events:none;background-color:rgba(0,0,0,.7)}.artplayer-video-player .artplayer-bottom .artplayer-controls{position:relative;pointer-events:all;display:flex;align-items:center;justify-content:space-between;height:36px}.artplayer-video-player .artplayer-bottom .artplayer-controls .art-control{float:left;font-size:12px;height:36px;cursor:pointer}.artplayer-video-player .artplayer-bottom .artplayer-controls .art-control .art-icon{display:flex;align-items:center;justify-content:center;float:left;height:36px;width:36px;padding:7px}.artplayer-video-player .artplayer-bottom .artplayer-controls .art-control-volume .art-volume-panel{position:relative;float:left;width:0;height:100%;transition:margin .2s cubic-bezier(.4,0,1,1),width .2s cubic-bezier(.4,0,1,1);overflow:hidden}.artplayer-video-player .artplayer-bottom .artplayer-controls .art-control-volume .art-volume-panel .art-volume-slider-handle{position:absolute;top:50%;left:0;width:12px;height:12px;border-radius:12px;margin-top:-6px;background:#fff}.artplayer-video-player .artplayer-bottom .artplayer-controls .art-control-volume .art-volume-panel .art-volume-slider-handle:before{left:-54px;background:#fff}.artplayer-video-player .artplayer-bottom .artplayer-controls .art-control-volume .art-volume-panel .art-volume-slider-handle:after{left:6px;background:hsla(0,0%,100%,.2)}.artplayer-video-player .artplayer-bottom .artplayer-controls .art-control-volume .art-volume-panel .art-volume-slider-handle:after,.artplayer-video-player .artplayer-bottom .artplayer-controls .art-control-volume .art-volume-panel .art-volume-slider-handle:before{content:"";position:absolute;display:block;top:50%;height:3px;margin-top:-2px;width:60px}.artplayer-video-player .artplayer-bottom .artplayer-controls .art-control-volume .art-volume-panel.art-volume-panel-hover{width:60px}.artplayer-video-player .artplayer-bottom .artplayer-controls .art-control-time{line-height:36px;padding:0 10px}.artplayer-video-player .artplayer-bottom .artplayer-controls .art-control-quality{position:relative;z-index:30;line-height:Line truncated
.artplayer-video-player .artplayer-bottom{position:absolute;z-index:60;left:0;right:0;bottom:0;height:100px;padding:60px 10px 0;opacity:0;visibility:hidden;transition:all .2s ease-in-out;pointer-events:none;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAADGCAYAAAAT+OqFAAAAdklEQVQoz42QQQ7AIAgEF/T/D+kbq/RWAlnQyyazA4aoAB4FsBSA/bFjuF1EOL7VbrIrBuusmrt4ZZORfb6ehbWdnRHEIiITaEUKa5EJqUakRSaEYBJSCY2dEstQY7AuxahwXFrvZmWl2rh4JZ07z9dLtesfNj5q0FU3A5ObbwAAAABJRU5ErkJggg==) repeat-x bottom}.artplayer-video-player .artplayer-bottom .artplayer-progress{position:relative;pointer-events:all}.artplayer-video-player .artplayer-bottom .artplayer-progress .art-control-progress{position:relative;height:5px;padding:1px 0;cursor:pointer}.artplayer-video-player .artplayer-bottom .artplayer-progress .art-control-progress .art-control-progress-inner{position:relative;height:100%;background:hsla(0,0%,100%,.2)}.artplayer-video-player .artplayer-bottom .artplayer-progress .art-control-progress .art-control-progress-inner .art-progress-loaded{position:absolute;z-index:10;left:0;top:0;right:0;bottom:0;height:100%;width:0;background:hsla(0,0%,100%,.4)}.artplayer-video-player .artplayer-bottom .artplayer-progress .art-control-progress .art-control-progress-inner .art-progress-played{position:absolute;z-index:20;left:0;top:0;right:0;bottom:0;height:100%;width:0}.artplayer-video-player .artplayer-bottom .artplayer-progress .art-control-progress .art-control-progress-inner .art-progress-highlight{position:absolute;z-index:30;left:0;top:0;right:0;bottom:0;height:0}.artplayer-video-player .artplayer-bottom .artplayer-progress .art-control-progress .art-control-progress-inner .art-progress-highlight span{display:inline-block;position:absolute;left:0;top:0;width:7px;height:3px;background:#fff;border-radius:3px}.artplayer-video-player .artplayer-bottom .artplayer-progress .art-control-progress .art-control-progress-inner .art-progress-indicator{display:none;position:absolute;z-index:40;top:-5px;left:-6.5px;width:13px;height:13px;border-radius:50%}.artplayer-video-player .artplayer-bottom .artplayer-progress .art-control-progress .art-control-progress-inner .art-progress-indicator.show-indicator{display:block}.artplayer-video-player .artplayer-bottom .artplayer-progress .art-control-progress .art-control-progress-inner .art-progress-tip{display:none;position:absolute;z-index:50;top:-25px;left:0;height:20px;padding:0 5px;line-height:20px;color:#fff;font-size:12px;text-align:center;background:rgba(0,0,0,.7);border-radius:3px;font-weight:700}.artplayer-video-player .artplayer-bottom .artplayer-progress .art-control-progress:hover .art-progress-indicator,.artplayer-video-player .artplayer-bottom .artplayer-progress .art-control-progress:hover .art-progress-tip{display:block}.artplayer-video-player .artplayer-bottom .artplayer-progress .art-control-thumbnails{display:none;position:absolute;bottom:8px;left:0;pointer-events:none;background-color:rgba(0,0,0,.7)}.artplayer-video-player .artplayer-bottom .artplayer-controls{position:relative;pointer-events:all;display:flex;align-items:center;justify-content:space-between;height:36px}.artplayer-video-player .artplayer-bottom .artplayer-controls .art-control{opacity:.9;float:left;font-size:12px;height:36px;cursor:pointer}.artplayer-video-player .artplayer-bottom .artplayer-controls .art-control .art-icon{display:flex;align-items:center;justify-content:center;float:left;height:36px;width:36px;padding:7px}.artplayer-video-player .artplayer-bottom .artplayer-controls .art-control:hover{opacity:1}.artplayer-video-player .artplayer-bottom .artplayer-controls .art-control-volume .art-volume-panel{position:relative;float:left;width:0;height:100%;transition:margin .2s cubic-bezier(.4,0,1,1),width .2s cubic-bezier(.4,0,1,1);overflow:hidden}.artplayer-video-player .artplayer-bottom .artplayer-controls .art-control-volume .art-volume-panel .art-volume-slider-handle{position:absolute;top:50%;left:0;width:12px;height:12px;border-radius:12px;margin-top:-6px;background:#fff}.artplayer-video-player .artplayer-bottom .artplayer-controls .art-control-volume .art-volume-panel .art-volume-slider-handle:before{left:-54px;background:#fff}.artplayer-video-player .artplayer-bottom .artplayer-controls .art-control-volume .art-volume-panel .art-volume-slider-handle:after{left:6px;background:hsla(0,0%,100%,.2)}.artplayer-video-player .artplayer-bottom .artplayer-controls .art-control-volume .art-volume-panel .art-volume-slider-handle:after,.artplayer-video-player .artplayer-bottom .artplayer-controls .art-control-volume .art-volume-panel .art-volume-slider-handle:before{content:"";position:absolute;display:block;top:50%;height:3px;margin-top:-2px;width:60px}.artplayer-video-player .artplayer-bottom .artplayer-controls .art-control-volume .art-volume-panel.art-volume-panel-hover{width:60px}.artplayer-video-player .artplayer-bottom .artplayer-controls .art-control-time{line-height:36px;padding:0 10px}.artplayer-video-playeLine truncated
.artplayer-video-player .artplayer-notice{display:none;font-size:14px;position:absolute;z-index:80;left:0;top:0;padding:10px;width:100%;pointer-events:none}.artplayer-video-player .artplayer-notice .artplayer-notice-inner{display:inline-block;padding:5px 10px;color:#fff;background:rgba(0,0,0,.6);border-radius:3px}
.artplayer-video-player .artplayer-contextmenu{position:absolute;z-index:100;left:0;top:0;min-width:200px;padding:5px 0;background:rgba(0,0,0,.8);border-radius:3px}.artplayer-video-player .artplayer-contextmenu .art-menu{cursor:pointer;font-size:13px;display:block;color:#fff;padding:7px 10px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-shadow:0 0 2px rgba(0,0,0,.5);border-bottom:1px solid hsla(0,0%,100%,.1)}.artplayer-video-player .artplayer-contextmenu .art-menu a{color:#fff;text-decoration:none}.artplayer-video-player .artplayer-contextmenu .art-menu span{display:inline-block;padding:0 7px}.artplayer-video-player .artplayer-contextmenu .art-menu span.current,.artplayer-video-player .artplayer-contextmenu .art-menu span:hover{color:#00c9ff}.artplayer-video-player .artplayer-contextmenu .art-menu:hover{background-color:hsla(0,0%,100%,.1)}.artplayer-video-player .artplayer-contextmenu .art-menu:last-child{border-bottom:none}
.artplayer-video-player .artplayer-info{display:none;position:absolute;left:10px;top:10px;z-index:90;width:350px;min-height:150px;padding:10px;color:#fff;font-size:12px;font-family:Noto Sans CJK SC DemiLight,Roboto,Segoe UI,Tahoma,Arial,Helvetica,sans-serif;-webkit-font-smoothing:antialiased;background:rgba(0,0,0,.7)}.artplayer-video-player .artplayer-info .art-info-item{display:flex;margin-bottom:5px}.artplayer-video-player .artplayer-info .art-info-item .art-info-title{width:100px;text-align:right}.artplayer-video-player .artplayer-info .art-info-item .art-info-content{flex:1;padding-left:5px}.artplayer-video-player .artplayer-info .artplayer-info-close{position:absolute;top:5px;right:5px;cursor:pointer}
.artplayer-video-player .artplayer-info{display:none;position:absolute;left:10px;top:10px;z-index:100;width:350px;min-height:150px;padding:10px;color:#fff;font-size:12px;font-family:Noto Sans CJK SC DemiLight,Roboto,Segoe UI,Tahoma,Arial,Helvetica,sans-serif;-webkit-font-smoothing:antialiased;background:rgba(0,0,0,.7)}.artplayer-video-player .artplayer-info .art-info-item{display:flex;margin-bottom:5px}.artplayer-video-player .artplayer-info .art-info-item .art-info-title{width:100px;text-align:right}.artplayer-video-player .artplayer-info .art-info-item .art-info-content{flex:1;padding-left:5px}.artplayer-video-player .artplayer-info .artplayer-info-close{position:absolute;top:5px;right:5px;cursor:pointer}
.artplayer-video-player[data-aspect-ratio] video{box-sizing:content-box;-o-object-fit:fill;object-fit:fill}
button[data-balloon]{overflow:visible}[data-balloon]{position:relative;cursor:pointer}[data-balloon]:after{font-family:sans-serif!important;font-weight:400!important;font-style:normal!important;text-shadow:none!important;font-size:12px!important;background:rgba(17,17,17,.9);border-radius:4px;color:#fff;content:attr(data-balloon);padding:.5em 1em;white-space:nowrap}[data-balloon]:after,[data-balloon]:before{filter:alpha(opactiy=0);-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";-moz-opacity:0;-khtml-opacity:0;opacity:0;pointer-events:none;transition:all .18s ease-out .18s;position:absolute;z-index:10}[data-balloon]:before{background:no-repeat url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='36' height='12'%3E%3Cpath fill='rgba(17,17,17,0.9)' d='M2.658 0h32.004c-6 0-11.627 12.002-16.002 12.002C14.285 12.002 8.594 0 2.658 0z'/%3E%3C/svg%3E");background-size:100% auto;width:18px;height:6px;content:""}[data-balloon]:hover:after,[data-balloon]:hover:before,[data-balloon][data-balloon-visible]:after,[data-balloon][data-balloon-visible]:before{filter:alpha(opactiy=100);-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=100)";-moz-opacity:1;-khtml-opacity:1;opacity:1;pointer-events:auto}[data-balloon].font-awesome:after{font-family:FontAwesome}[data-balloon][data-balloon-break]:after{white-space:pre}[data-balloon][data-balloon-blunt]:after,[data-balloon][data-balloon-blunt]:before{transition:none}[data-balloon][data-balloon-pos=up]:after{margin-bottom:11px}[data-balloon][data-balloon-pos=up]:after,[data-balloon][data-balloon-pos=up]:before{bottom:100%;left:50%;-webkit-transform:translate(-50%,10px);transform:translate(-50%,10px);-webkit-transform-origin:top;transform-origin:top}[data-balloon][data-balloon-pos=up]:before{margin-bottom:5px}[data-balloon][data-balloon-pos=up]:hover:after,[data-balloon][data-balloon-pos=up]:hover:before,[data-balloon][data-balloon-pos=up][data-balloon-visible]:after,[data-balloon][data-balloon-pos=up][data-balloon-visible]:before{-webkit-transform:translate(-50%);transform:translate(-50%)}[data-balloon][data-balloon-pos=up-left]:after{left:0;margin-bottom:11px}[data-balloon][data-balloon-pos=up-left]:after,[data-balloon][data-balloon-pos=up-left]:before{bottom:100%;-webkit-transform:translateY(10px);transform:translateY(10px);-webkit-transform-origin:top;transform-origin:top}[data-balloon][data-balloon-pos=up-left]:before{left:5px;margin-bottom:5px}[data-balloon][data-balloon-pos=up-left]:hover:after,[data-balloon][data-balloon-pos=up-left]:hover:before,[data-balloon][data-balloon-pos=up-left][data-balloon-visible]:after,[data-balloon][data-balloon-pos=up-left][data-balloon-visible]:before{-webkit-transform:translate(0);transform:translate(0)}[data-balloon][data-balloon-pos=up-right]:after{right:0;margin-bottom:11px}[data-balloon][data-balloon-pos=up-right]:after,[data-balloon][data-balloon-pos=up-right]:before{bottom:100%;-webkit-transform:translateY(10px);transform:translateY(10px);-webkit-transform-origin:top;transform-origin:top}[data-balloon][data-balloon-pos=up-right]:before{right:5px;margin-bottom:5px}[data-balloon][data-balloon-pos=up-right]:hover:after,[data-balloon][data-balloon-pos=up-right]:hover:before,[data-balloon][data-balloon-pos=up-right][data-balloon-visible]:after,[data-balloon][data-balloon-pos=up-right][data-balloon-visible]:before{-webkit-transform:translate(0);transform:translate(0)}[data-balloon][data-balloon-pos=down]:after{margin-top:11px}[data-balloon][data-balloon-pos=down]:after,[data-balloon][data-balloon-pos=down]:before{left:50%;top:100%;-webkit-transform:translate(-50%,-10px);transform:translate(-50%,-10px)}[data-balloon][data-balloon-pos=down]:before{background:no-repeat url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='36' height='12'%3E%3Cpath fill='rgba(17,17,17,0.9)' d='M33.342 12H1.338c6 0 11.627-12.002 16.002-12.002C21.715-.002 27.406 12 33.342 12z'/%3E%3C/svg%3E");background-size:100% auto;width:18px;height:6px;margin-top:5px}[data-balloon][data-balloon-pos=down]:hover:after,[data-balloon][data-balloon-pos=down]:hover:before,[data-balloon][data-balloon-pos=down][data-balloon-visible]:after,[data-balloon][data-balloon-pos=down][data-balloon-visible]:before{-webkit-transform:translate(-50%);transform:translate(-50%)}[data-balloon][data-balloon-pos=down-left]:after{left:0;margin-top:11px;top:100%;-webkit-transform:translateY(-10px);transform:translateY(-10px)}[data-balloon][data-balloon-pos=down-left]:before{background:no-repeat url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='36' height='12'%3E%3Cpath fill='rgba(17,17,17,0.9)' d='M33.342 12H1.338c6 0 11.627-12.002 16.002-12.002C21.715-.002 27.406 12 33.342 12z'/%3E%3C/svg%3E");background-size:100% auto;width:18px;height:6px;left:5px;margin-top:5px;top:100%;-webkit-transform:translateY(-10px);transform:translateY(-10px)}[data-balloon][data-balloon-pos=down-left]Line truncated
button[data-balloon]{overflow:visible}[data-balloon]{position:relative;cursor:pointer}[data-balloon]:after{font-family:sans-serif!important;font-weight:400!important;font-style:normal!important;text-shadow:none!important;font-size:12px!important;background:rgba(17,17,17,.9);border-radius:4px;color:#fff;content:attr(data-balloon);padding:.5em 1em;white-space:nowrap}[data-balloon]:after,[data-balloon]:before{filter:alpha(opactiy=0);-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";-moz-opacity:0;-khtml-opacity:0;opacity:0;pointer-events:none;transition:all .18s ease-out .18s;position:absolute;z-index:10}[data-balloon]:before{background:no-repeat url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='36' height='12'%3E%3Cpath fill='rgba(17,17,17,0.9)' d='M2.658 0h32.004c-6 0-11.627 12.002-16.002 12.002C14.285 12.002 8.594 0 2.658 0z'/%3E%3C/svg%3E");background-size:100% auto;width:18px;height:6px;content:""}[data-balloon]:hover:after,[data-balloon]:hover:before,[data-balloon][data-balloon-visible]:after,[data-balloon][data-balloon-visible]:before{filter:alpha(opactiy=100);-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=100)";-moz-opacity:1;-khtml-opacity:1;opacity:1;pointer-events:auto}[data-balloon].font-awesome:after{font-family:FontAwesome}[data-balloon][data-balloon-break]:after{white-space:pre}[data-balloon][data-balloon-blunt]:after,[data-balloon][data-balloon-blunt]:before{transition:none}[data-balloon][data-balloon-pos=up]:after{margin-bottom:11px}[data-balloon][data-balloon-pos=up]:after,[data-balloon][data-balloon-pos=up]:before{bottom:100%;left:50%;-webkit-transform:translate(-50%,10px);transform:translate(-50%,10px);-webkit-transform-origin:top;transform-origin:top}[data-balloon][data-balloon-pos=up]:before{margin-bottom:5px}[data-balloon][data-balloon-pos=up]:hover:after,[data-balloon][data-balloon-pos=up]:hover:before,[data-balloon][data-balloon-pos=up][data-balloon-visible]:after,[data-balloon][data-balloon-pos=up][data-balloon-visible]:before{-webkit-transform:translate(-50%);transform:translate(-50%)}[data-balloon][data-balloon-pos=up-left]:after{left:0;margin-bottom:11px}[data-balloon][data-balloon-pos=up-left]:after,[data-balloon][data-balloon-pos=up-left]:before{bottom:100%;-webkit-transform:translateY(10px);transform:translateY(10px);-webkit-transform-origin:top;transform-origin:top}[data-balloon][data-balloon-pos=up-left]:before{left:5px;margin-bottom:5px}[data-balloon][data-balloon-pos=up-left]:hover:after,[data-balloon][data-balloon-pos=up-left]:hover:before,[data-balloon][data-balloon-pos=up-left][data-balloon-visible]:after,[data-balloon][data-balloon-pos=up-left][data-balloon-visible]:before{-webkit-transform:translate(0);transform:translate(0)}[data-balloon][data-balloon-pos=up-right]:after{right:0;margin-bottom:11px}[data-balloon][data-balloon-pos=up-right]:after,[data-balloon][data-balloon-pos=up-right]:before{bottom:100%;-webkit-transform:translateY(10px);transform:translateY(10px);-webkit-transform-origin:top;transform-origin:top}[data-balloon][data-balloon-pos=up-right]:before{right:5px;margin-bottom:5px}[data-balloon][data-balloon-pos=up-right]:hover:after,[data-balloon][data-balloon-pos=up-right]:hover:before,[data-balloon][data-balloon-pos=up-right][data-balloon-visible]:after,[data-balloon][data-balloon-pos=up-right][data-balloon-visible]:before{-webkit-transform:translate(0);transform:translate(0)}[data-balloon][data-balloon-pos=down]:after{margin-top:11px}[data-balloon][data-balloon-pos=down]:after,[data-balloon][data-balloon-pos=down]:before{left:50%;top:100%;-webkit-transform:translate(-50%,-10px);transform:translate(-50%,-10px)}[data-balloon][data-balloon-pos=down]:before{background:no-repeat url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='36' height='12'%3E%3Cpath fill='rgba(17,17,17,0.9)' d='M33.342 12H1.338c6 0 11.627-12.002 16.002-12.002C21.715-.002 27.406 12 33.342 12z'/%3E%3C/svg%3E");background-size:100% auto;width:18px;height:6px;margin-top:5px}[data-balloon][data-balloon-pos=down]:hover:after,[data-balloon][data-balloon-pos=down]:hover:before,[data-balloon][data-balloon-pos=down][data-balloon-visible]:after,[data-balloon][data-balloon-pos=down][data-balloon-visible]:before{-webkit-transform:translate(-50%);transform:translate(-50%)}[data-balloon][data-balloon-pos=down-left]:after{left:0;margin-top:11px;top:100%;-webkit-transform:translateY(-10px);transform:translateY(-10px)}[data-balloon][data-balloon-pos=down-left]:before{background:no-repeat url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='36' height='12'%3E%3Cpath fill='rgba(17,17,17,0.9)' d='M33.342 12H1.338c6 0 11.627-12.002 16.002-12.002C21.715-.002 27.406 12 33.342 12z'/%3E%3C/svg%3E");background-size:100% auto;width:18px;height:6px;left:5px;margin-top:5px;top:100%;-webkit-transform:translateY(-10px);transform:translateY(-10px)}[data-balloon][data-balloon-pos=down-left]Line truncated
.artplayer-video-player .artplayer-setting{display:none;font-size:14px;position:absolute;z-index:90;left:0;top:0;height:100%;width:100%;align-items:center;justify-content:center;pointer-events:none}.artplayer-video-player .artplayer-setting .artplayer-setting-inner{width:350px;height:250px;padding:10px;color:#fff;background:rgba(0,0,0,.6);border-radius:3px;pointer-events:all}
+9 -3
View File
@@ -37,6 +37,15 @@
width: 190,
height: 107
},
contextmenu: [
{
html: '自定义菜单 - 天黑请关灯 Σ(っ °Д °;)っ',
click: function () {
document.body.classList.toggle('dark');
this.hide();
}
}
],
quality: [
{
default: true,
@@ -92,10 +101,7 @@
});
});
// console.dir(Artplayer);
console.log(player);
Artplayer.config.video.events.forEach(item => {
player.on('video:' + item, event => {
console.log('video', event);
+132 -51
View File
@@ -469,8 +469,9 @@
}
},
contextmenu: {
type: 'array|function',
type: 'array',
child: {
type: 'object|function',
name: 'string',
html: {
validator: validElement
@@ -638,7 +639,7 @@
key: "init",
value: function init() {
var refs = this.art.refs;
refs.$container.innerHTML = "\n <div class=\"artplayer-video-player\">\n <video class=\"artplayer-video\"></video>\n <div class=\"artplayer-subtitle\"></div>\n <div class=\"artplayer-danmu\"></div>\n <div class=\"artplayer-layers\"></div>\n <div class=\"artplayer-mask\"></div>\n <div class=\"artplayer-bottom\">\n <div class=\"artplayer-progress\"></div>\n <div class=\"artplayer-controls\">\n <div class=\"artplayer-controls-left\"></div>\n <div class=\"artplayer-controls-right\"></div>\n </div>\n </div>\n <div class=\"artplayer-loading\"></div>\n <div class=\"artplayer-notice\">\n <div class=\"artplayer-notice-inner\"></div>\n </div>\n <div class=\"artplayer-info\">\n <div class=\"artplayer-info-panel\"></div>\n <div class=\"artplayer-info-close\">[x]</div>\n </div>\n </div>\n ";
refs.$container.innerHTML = "\n <div class=\"artplayer-video-player\">\n <video class=\"artplayer-video\"></video>\n <div class=\"artplayer-subtitle\"></div>\n <div class=\"artplayer-danmu\"></div>\n <div class=\"artplayer-layers\"></div>\n <div class=\"artplayer-mask\"></div>\n <div class=\"artplayer-bottom\">\n <div class=\"artplayer-progress\"></div>\n <div class=\"artplayer-controls\">\n <div class=\"artplayer-controls-left\"></div>\n <div class=\"artplayer-controls-right\"></div>\n </div>\n </div>\n <div class=\"artplayer-loading\"></div>\n <div class=\"artplayer-notice\">\n <div class=\"artplayer-notice-inner\"></div>\n </div>\n <div class=\"artplayer-setting\">\n <div class=\"artplayer-setting-inner\"></div>\n </div>\n <div class=\"artplayer-info\">\n <div class=\"artplayer-info-panel\"></div>\n <div class=\"artplayer-info-close\">[x]</div>\n </div>\n </div>\n ";
refs.$player = refs.$container.querySelector('.artplayer-video-player');
refs.$video = refs.$container.querySelector('.artplayer-video');
refs.$subtitle = refs.$container.querySelector('.artplayer-subtitle');
@@ -653,6 +654,8 @@
refs.$notice = refs.$container.querySelector('.artplayer-notice');
refs.$noticeInner = refs.$container.querySelector('.artplayer-notice-inner');
refs.$mask = refs.$container.querySelector('.artplayer-mask');
refs.$setting = refs.$container.querySelector('.artplayer-setting');
refs.$settingInner = refs.$container.querySelector('.artplayer-setting-inner');
refs.$info = refs.$container.querySelector('.artplayer-info');
refs.$infoPanel = refs.$container.querySelector('.artplayer-info-panel');
refs.$infoClose = refs.$container.querySelector('.artplayer-info-close');
@@ -683,7 +686,9 @@
'Aspect ratio': '画面比例',
'Default': '默认',
'Normal': '正常',
'Switch': '切换'
'Switch': '切换',
'Hide setting': '隐藏设置',
'Show setting': '显示设置'
},
'zh-tw': {
'About author': '關於作者',
@@ -705,7 +710,9 @@
'Aspect ratio': '畫面比例',
'Default': '默認',
'Normal': '正常',
'Switch': '切換'
'Switch': '切換',
'Hide setting': '隱藏設置',
'Show setting': '顯示設置'
}
};
@@ -1141,13 +1148,11 @@
var subtitle = "<svg style=\"width: 100%; height: 100%\" viewBox=\"0 0 48 48\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M0 0h48v48H0z\" fill=\"none\"/>\n <path d=\"M40 8H8c-2.21 0-4 1.79-4 4v24c0 2.21 1.79 4 4 4h32c2.21 0 4-1.79 4-4V12c0-2.21-1.79-4-4-4zM8 24h8v4H8v-4zm20 12H8v-4h20v4zm12 0h-8v-4h8v4zm0-8H20v-4h20v4z\"/>\n</svg>";
var subtitleClose = "<svg style=\"width: 100%; height: 100%; opacity: .5\" viewBox=\"0 0 48 48\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M0 0h48v48H0z\" fill=\"none\"/>\n <path d=\"M40 8H8c-2.21 0-4 1.79-4 4v24c0 2.21 1.79 4 4 4h32c2.21 0 4-1.79 4-4V12c0-2.21-1.79-4-4-4zM8 24h8v4H8v-4zm20 12H8v-4h20v4zm12 0h-8v-4h8v4zm0-8H20v-4h20v4z\"/>\n</svg>";
var screenshot = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 50 50\" style=\"width: 100%; height: 100%\">\n\t<g id=\"surface1\">\n\t\t<path d=\"M 19.402344 6 C 17.019531 6 14.96875 7.679688 14.5 10.011719 L 14.097656 12 L 9 12 C 6.238281 12 4 14.238281 4 17 L 4 38 C 4 40.761719 6.238281 43 9 43 L 41 43 C 43.761719 43 46 40.761719 46 38 L 46 17 C 46 14.238281 43.761719 12 41 12 L 35.902344 12 L 35.5 10.011719 C 35.03125 7.679688 32.980469 6 30.597656 6 Z M 25 17 C 30.519531 17 35 21.480469 35 27 C 35 32.519531 30.519531 37 25 37 C 19.480469 37 15 32.519531 15 27 C 15 21.480469 19.480469 17 25 17 Z M 25 19 C 20.589844 19 17 22.589844 17 27 C 17 31.410156 20.589844 35 25 35 C 29.410156 35 33 31.410156 33 27 C 33 22.589844 29.410156 19 25 19 Z \"/>\n\t</g>\n</svg>\n";
var danmu = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 60 60\" style=\"width: 85%; height: 85%\">\r\n\t<path d=\"M54,2.5H6c-3.252,0-6,2.748-6,6v33c0,3.252,2.748,6,6,6h14.555l8.702,9.669C29.446,57.38,29.717,57.5,30,57.5 s0.554-0.12,0.743-0.331l8.702-9.669H54c3.252,0,6-2.748,6-6v-33C60,5.248,57.252,2.5,54,2.5z M16,28.5c-2.206,0-4-1.794-4-4 s1.794-4,4-4s4,1.794,4,4S18.206,28.5,16,28.5z M30,28.5c-2.206,0-4-1.794-4-4s1.794-4,4-4s4,1.794,4,4S32.206,28.5,30,28.5z M44,28.5c-2.206,0-4-1.794-4-4s1.794-4,4-4s4,1.794,4,4S46.206,28.5,44,28.5z\"/>\r\n</svg>\r\n";
var danmuClose = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 60 60\" style=\"width: 85%; height: 85%; opacity: .5\">\r\n\t<path d=\"M54,2.5H6c-3.252,0-6,2.748-6,6v33c0,3.252,2.748,6,6,6h14.555l8.702,9.669C29.446,57.38,29.717,57.5,30,57.5 s0.554-0.12,0.743-0.331l8.702-9.669H54c3.252,0,6-2.748,6-6v-33C60,5.248,57.252,2.5,54,2.5z M16,28.5c-2.206,0-4-1.794-4-4 s1.794-4,4-4s4,1.794,4,4S18.206,28.5,16,28.5z M30,28.5c-2.206,0-4-1.794-4-4s1.794-4,4-4s4,1.794,4,4S32.206,28.5,30,28.5z M44,28.5c-2.206,0-4-1.794-4-4s1.794-4,4-4s4,1.794,4,4S46.206,28.5,44,28.5z\"/>\r\n</svg>\r\n";
var setting = "<svg xmlns=\"http://www.w3.org/2000/svg\" style=\"width: 100%; height: 100%\" viewBox=\"0 0 22 22\">\n <circle cx=\"11\" cy=\"11\" r=\"2\"></circle>\n <path d=\"M19.164 8.861L17.6 8.6a6.978 6.978 0 0 0-1.186-2.099l.574-1.533a1 1 0 0 0-.436-1.217l-1.997-1.153a1.001 1.001 0 0 0-1.272.23l-1.008 1.225a7.04 7.04 0 0 0-2.55.001L8.716 2.829a1 1 0 0 0-1.272-.23L5.447 3.751a1 1 0 0 0-.436 1.217l.574 1.533A6.997 6.997 0 0 0 4.4 8.6l-1.564.261A.999.999 0 0 0 2 9.847v2.306c0 .489.353.906.836.986l1.613.269a7 7 0 0 0 1.228 2.075l-.558 1.487a1 1 0 0 0 .436 1.217l1.997 1.153c.423.244.961.147 1.272-.23l1.04-1.263a7.089 7.089 0 0 0 2.272 0l1.04 1.263a1 1 0 0 0 1.272.23l1.997-1.153a1 1 0 0 0 .436-1.217l-.557-1.487c.521-.61.94-1.31 1.228-2.075l1.613-.269a.999.999 0 0 0 .835-.986V9.847a.999.999 0 0 0-.836-.986zM11 15a4 4 0 1 1 0-8 4 4 0 0 1 0 8z\"></path>\n</svg>";
var icons = {
loading: loading,
@@ -1157,10 +1162,9 @@
volume: volume,
volumeClose: volumeClose,
subtitle: subtitle,
subtitleClose: subtitleClose,
screenshot: screenshot,
danmu: danmu,
danmuClose: danmuClose
setting: setting
};
function creatDomFromSvg(map) {
@@ -1192,23 +1196,22 @@
value: function apply(art) {
var _this = this;
var $control = this.option.$control;
var proxy = art.events.proxy,
danmu = art.danmu,
i18n = art.i18n;
this.$danmu = append(this.option.$control, icons$1.danmu);
this.$danmuClose = append(this.option.$control, icons$1.danmuClose);
i18n = art.i18n,
danmu = art.danmu;
this.$danmu = append($control, icons$1.danmu);
tooltip(this.$danmu, i18n.get('Hide danmu'));
tooltip(this.$danmuClose, i18n.get('Show danmu'));
setStyle(this.$danmuClose, 'display', 'none');
proxy(this.$danmu, 'click', function () {
danmu.hide();
setStyle(_this.$danmu, 'display', 'none');
setStyle(_this.$danmuClose, 'display', 'flex');
});
proxy(this.$danmuClose, 'click', function () {
danmu.show();
setStyle(_this.$danmu, 'display', 'flex');
setStyle(_this.$danmuClose, 'display', 'none');
proxy($control, 'click', function () {
if (danmu.isOpen) {
danmu.hide();
setStyle(_this.$danmu, 'opacity', '1');
tooltip(_this.$danmu, i18n.get('Show danmu'));
} else {
danmu.show();
setStyle(_this.$danmu, 'opacity', '0.8');
tooltip(_this.$danmu, i18n.get('Hide danmu'));
}
});
}
}]);
@@ -1503,23 +1506,22 @@
value: function apply(art) {
var _this = this;
var $control = this.option.$control;
var proxy = art.events.proxy,
subtitle = art.subtitle,
i18n = art.i18n;
this.$subtitle = append(this.option.$control, icons$1.subtitle);
this.$subtitleClose = append(this.option.$control, icons$1.subtitleClose);
i18n = art.i18n,
subtitle = art.subtitle;
this.$subtitle = append($control, icons$1.subtitle);
tooltip(this.$subtitle, i18n.get('Hide subtitle'));
tooltip(this.$subtitleClose, i18n.get('Show subtitle'));
setStyle(this.$subtitleClose, 'display', 'none');
proxy(this.$subtitle, 'click', function () {
subtitle.hide();
setStyle(_this.$subtitle, 'display', 'none');
setStyle(_this.$subtitleClose, 'display', 'flex');
});
proxy(this.$subtitleClose, 'click', function () {
subtitle.show();
setStyle(_this.$subtitle, 'display', 'flex');
setStyle(_this.$subtitleClose, 'display', 'none');
proxy($control, 'click', function () {
if (subtitle.isOpen) {
subtitle.hide();
setStyle(_this.$subtitle, 'opacity', '1');
tooltip(_this.$subtitle, i18n.get('Show subtitle'));
} else {
subtitle.show();
setStyle(_this.$subtitle, 'opacity', '0.8');
tooltip(_this.$subtitle, i18n.get('Hide subtitle'));
}
});
}
}]);
@@ -1700,7 +1702,25 @@
createClass(Setting, [{
key: "apply",
value: function apply(art) {
this.art = art;
var _this = this;
var $control = this.option.$control;
var proxy = art.events.proxy,
i18n = art.i18n,
setting = art.setting;
this.$setting = append($control, icons$1.setting);
tooltip(this.$setting, i18n.get('Show setting'));
proxy($control, 'click', function () {
if (setting.isOpen) {
setting.hide();
setStyle(_this.$setting, 'opacity', '1');
tooltip(_this.$setting, i18n.get('Show setting'));
} else {
setting.show();
setStyle(_this.$setting, 'opacity', '0.8');
tooltip(_this.$setting, i18n.get('Hide setting'));
}
});
}
}]);
@@ -1963,28 +1983,28 @@
position: 'left',
index: 30
}));
this.add(new Quality({
disable: this.art.option.quality.length === 0,
position: 'right',
index: 10
}));
this.add(new Danmu({
disable: false,
position: 'right',
index: 10
index: 20
}));
this.add(new Screenshot({
disable: !this.art.option.screenshot,
position: 'right',
index: 20
index: 30
}));
this.add(new Subtitle({
disable: !this.art.option.subtitle.url,
position: 'right',
index: 30
}));
this.add(new Quality({
disable: this.art.option.quality.length === 0,
position: 'right',
index: 40
}));
this.add(new Setting({
disable: false,
disable: !this.art.option.setting,
position: 'right',
index: 50
}));
@@ -2243,7 +2263,7 @@
if (menu.click) {
proxy($menu, 'click', function (event) {
event.preventDefault();
menu.click(event);
menu.click.call(_this2, event);
_this2.art.emit('contextmenu:click', $menu);
});
@@ -2253,8 +2273,8 @@
return $menu;
}).sort(function (a, b) {
return Number(a.dataset.artMenuId) - Number(b.dataset.artMenuId);
}).forEach(function ($menu) {
append(refs.$contextmenu, $menu);
}).forEach(function (item) {
append(refs.$contextmenu, item);
});
append(refs.$player, refs.$contextmenu);
}
@@ -2321,6 +2341,7 @@
classCallCheck(this, Danmu);
this.art = art;
this.isOpen = true;
this.init();
}
@@ -2336,6 +2357,7 @@
i18n = _this$art.i18n,
notice = _this$art.notice;
setStyle($danmu, 'display', 'block');
this.isOpen = true;
notice.show(i18n.get('Show danmu'));
this.art.emit('danmu:show', $danmu);
}
@@ -2347,6 +2369,7 @@
i18n = _this$art2.i18n,
notice = _this$art2.notice;
setStyle($danmu, 'display', 'none');
this.isOpen = false;
notice.show(i18n.get('Hide danmu'));
this.art.emit('danmu:hide', $danmu);
}
@@ -2483,6 +2506,7 @@
classCallCheck(this, Subtitle);
this.art = art;
this.isOpen = true;
var url = this.art.option.subtitle.url;
if (url) {
@@ -2575,6 +2599,7 @@
i18n = _this$art2.i18n,
notice = _this$art2.notice;
setStyle($subtitle, 'display', 'block');
this.isOpen = true;
notice.show(i18n.get('Show subtitle'));
this.art.emit('subtitle:show', $subtitle);
}
@@ -2586,6 +2611,7 @@
i18n = _this$art3.i18n,
notice = _this$art3.notice;
setStyle($subtitle, 'display', 'none');
this.isOpen = false;
notice.show(i18n.get('Hide subtitle'));
this.art.emit('subtitle:hide', $subtitle);
}
@@ -2916,6 +2942,59 @@
return Mask;
}();
var Setting$1 =
/*#__PURE__*/
function () {
function Setting(art) {
classCallCheck(this, Setting);
this.art = art;
this.isOpen = false;
this.init();
}
createClass(Setting, [{
key: "init",
value: function init() {//
}
}, {
key: "add",
value: function add() {//
}
}, {
key: "switch",
value: function _switch(name) {
console.log(name);
}
}, {
key: "show",
value: function show() {
var _this$art = this.art,
$setting = _this$art.refs.$setting,
i18n = _this$art.i18n,
notice = _this$art.notice;
setStyle($setting, 'display', 'flex');
this.isOpen = true;
notice.show(i18n.get('Show setting'));
this.art.emit('setting:show', $setting);
}
}, {
key: "hide",
value: function hide() {
var _this$art2 = this.art,
$setting = _this$art2.refs.$setting,
i18n = _this$art2.i18n,
notice = _this$art2.notice;
setStyle($setting, 'display', 'none');
this.isOpen = false;
notice.show(i18n.get('Hide setting'));
this.art.emit('setting:hide', $setting);
}
}]);
return Setting;
}();
var id$3 = 0;
var instances = [];
@@ -2971,6 +3050,7 @@
this.loading = new Loading(this);
this.hotkey = new Hotkey(this);
this.mask = new Mask(this);
this.setting = new Setting$1(this);
this.id = id$3++;
instances.push(this);
return this;
@@ -3042,6 +3122,7 @@
quality: [],
loading: '',
theme: '#f00',
setting: true,
hotkey: true,
pip: true,
fullscreen: true,
+1 -1
View File
@@ -1 +1 @@
{"version":3,"file":"artplayer.js","sources":["../../node_modules/@babel/runtime/helpers/setPrototypeOf.js","../../node_modules/@babel/runtime/helpers/construct.js","../../node_modules/@babel/runtime/helpers/arrayWithoutHoles.js","../../node_modules/@babel/runtime/helpers/iterableToArray.js","../../node_modules/@babel/runtime/helpers/nonIterableSpread.js","../../node_modules/@babel/runtime/helpers/toConsumableArray.js","../../node_modules/@babel/runtime/helpers/classCallCheck.js","../../node_modules/@babel/runtime/helpers/createClass.js","../../node_modules/@babel/runtime/helpers/typeof.js","../../node_modules/@babel/runtime/helpers/assertThisInitialized.js","../../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js","../../node_modules/@babel/runtime/helpers/getPrototypeOf.js","../../node_modules/@babel/runtime/helpers/inherits.js","../../node_modules/@babel/runtime/helpers/defineProperty.js","../../node_modules/@babel/runtime/helpers/objectSpread.js","../../node_modules/@babel/runtime/helpers/isNativeFunction.js","../../node_modules/@babel/runtime/helpers/wrapNativeSuper.js","../../src/utils/index.js","../../node_modules/option-validator/dist/option-validator.js","../../src/scheme/validElement.js","../../src/scheme/index.js","../../src/config/mimeCodec.js","../../src/config/mse.js","../../src/config/video.js","../../src/config/index.js","../../node_modules/tiny-emitter/index.js","../../src/template.js","../../src/i18n.js","../../src/player.js","../../node_modules/@babel/runtime/helpers/arrayWithHoles.js","../../node_modules/@babel/runtime/helpers/iterableToArrayLimit.js","../../node_modules/@babel/runtime/helpers/nonIterableRest.js","../../node_modules/@babel/runtime/helpers/slicedToArray.js","../../src/icons/index.js","../../src/controls/danmu.js","../../src/controls/fullscreen.js","../../src/controls/fullscreen-web.js","../../src/controls/pip.js","../../src/controls/playAndPause.js","../../src/controls/progress.js","../../src/controls/subtitle.js","../../src/controls/time.js","../../src/controls/volume.js","../../src/controls/setting.js","../../src/controls/thumbnails.js","../../src/controls/screenshot.js","../../src/controls/quality.js","../../src/controls/index.js","../../src/contextmenu/playbackRate.js","../../src/contextmenu/aspectRatio.js","../../src/contextmenu/info.js","../../src/contextmenu/version.js","../../src/contextmenu/close.js","../../src/contextmenu/index.js","../../src/danmu.js","../../src/info.js","../../src/subtitle.js","../../src/events.js","../../src/hotkey.js","../../src/layers.js","../../src/loading.js","../../src/notice.js","../../src/mask.js","../../src/index.js"],"sourcesContent":["function _setPrototypeOf(o, p) {\n module.exports = _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n\n return _setPrototypeOf(o, p);\n}\n\nmodule.exports = _setPrototypeOf;","var setPrototypeOf = require(\"./setPrototypeOf\");\n\nfunction isNativeReflectConstruct() {\n if (typeof Reflect === \"undefined\" || !Reflect.construct) return false;\n if (Reflect.construct.sham) return false;\n if (typeof Proxy === \"function\") return true;\n\n try {\n Date.prototype.toString.call(Reflect.construct(Date, [], function () {}));\n return true;\n } catch (e) {\n return false;\n }\n}\n\nfunction _construct(Parent, args, Class) {\n if (isNativeReflectConstruct()) {\n module.exports = _construct = Reflect.construct;\n } else {\n module.exports = _construct = function _construct(Parent, args, Class) {\n var a = [null];\n a.push.apply(a, args);\n var Constructor = Function.bind.apply(Parent, a);\n var instance = new Constructor();\n if (Class) setPrototypeOf(instance, Class.prototype);\n return instance;\n };\n }\n\n return _construct.apply(null, arguments);\n}\n\nmodule.exports = _construct;","function _arrayWithoutHoles(arr) {\n if (Array.isArray(arr)) {\n for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) {\n arr2[i] = arr[i];\n }\n\n return arr2;\n }\n}\n\nmodule.exports = _arrayWithoutHoles;","function _iterableToArray(iter) {\n if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === \"[object Arguments]\") return Array.from(iter);\n}\n\nmodule.exports = _iterableToArray;","function _nonIterableSpread() {\n throw new TypeError(\"Invalid attempt to spread non-iterable instance\");\n}\n\nmodule.exports = _nonIterableSpread;","var arrayWithoutHoles = require(\"./arrayWithoutHoles\");\n\nvar iterableToArray = require(\"./iterableToArray\");\n\nvar nonIterableSpread = require(\"./nonIterableSpread\");\n\nfunction _toConsumableArray(arr) {\n return arrayWithoutHoles(arr) || iterableToArray(arr) || nonIterableSpread();\n}\n\nmodule.exports = _toConsumableArray;","function _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\Line truncated
{"version":3,"file":"artplayer.js","sources":["../../node_modules/@babel/runtime/helpers/setPrototypeOf.js","../../node_modules/@babel/runtime/helpers/construct.js","../../node_modules/@babel/runtime/helpers/arrayWithoutHoles.js","../../node_modules/@babel/runtime/helpers/iterableToArray.js","../../node_modules/@babel/runtime/helpers/nonIterableSpread.js","../../node_modules/@babel/runtime/helpers/toConsumableArray.js","../../node_modules/@babel/runtime/helpers/classCallCheck.js","../../node_modules/@babel/runtime/helpers/createClass.js","../../node_modules/@babel/runtime/helpers/typeof.js","../../node_modules/@babel/runtime/helpers/assertThisInitialized.js","../../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js","../../node_modules/@babel/runtime/helpers/getPrototypeOf.js","../../node_modules/@babel/runtime/helpers/inherits.js","../../node_modules/@babel/runtime/helpers/defineProperty.js","../../node_modules/@babel/runtime/helpers/objectSpread.js","../../node_modules/@babel/runtime/helpers/isNativeFunction.js","../../node_modules/@babel/runtime/helpers/wrapNativeSuper.js","../../src/utils/index.js","../../node_modules/option-validator/dist/option-validator.js","../../src/scheme/validElement.js","../../src/scheme/index.js","../../src/config/mimeCodec.js","../../src/config/mse.js","../../src/config/video.js","../../src/config/index.js","../../node_modules/tiny-emitter/index.js","../../src/template.js","../../src/i18n.js","../../src/player.js","../../node_modules/@babel/runtime/helpers/arrayWithHoles.js","../../node_modules/@babel/runtime/helpers/iterableToArrayLimit.js","../../node_modules/@babel/runtime/helpers/nonIterableRest.js","../../node_modules/@babel/runtime/helpers/slicedToArray.js","../../src/icons/index.js","../../src/controls/danmu.js","../../src/controls/fullscreen.js","../../src/controls/fullscreen-web.js","../../src/controls/pip.js","../../src/controls/playAndPause.js","../../src/controls/progress.js","../../src/controls/subtitle.js","../../src/controls/time.js","../../src/controls/volume.js","../../src/controls/setting.js","../../src/controls/thumbnails.js","../../src/controls/screenshot.js","../../src/controls/quality.js","../../src/controls/index.js","../../src/contextmenu/playbackRate.js","../../src/contextmenu/aspectRatio.js","../../src/contextmenu/info.js","../../src/contextmenu/version.js","../../src/contextmenu/close.js","../../src/contextmenu/index.js","../../src/danmu.js","../../src/info.js","../../src/subtitle.js","../../src/events.js","../../src/hotkey.js","../../src/layers.js","../../src/loading.js","../../src/notice.js","../../src/mask.js","../../src/setting.js","../../src/index.js"],"sourcesContent":["function _setPrototypeOf(o, p) {\n module.exports = _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n\n return _setPrototypeOf(o, p);\n}\n\nmodule.exports = _setPrototypeOf;","var setPrototypeOf = require(\"./setPrototypeOf\");\n\nfunction isNativeReflectConstruct() {\n if (typeof Reflect === \"undefined\" || !Reflect.construct) return false;\n if (Reflect.construct.sham) return false;\n if (typeof Proxy === \"function\") return true;\n\n try {\n Date.prototype.toString.call(Reflect.construct(Date, [], function () {}));\n return true;\n } catch (e) {\n return false;\n }\n}\n\nfunction _construct(Parent, args, Class) {\n if (isNativeReflectConstruct()) {\n module.exports = _construct = Reflect.construct;\n } else {\n module.exports = _construct = function _construct(Parent, args, Class) {\n var a = [null];\n a.push.apply(a, args);\n var Constructor = Function.bind.apply(Parent, a);\n var instance = new Constructor();\n if (Class) setPrototypeOf(instance, Class.prototype);\n return instance;\n };\n }\n\n return _construct.apply(null, arguments);\n}\n\nmodule.exports = _construct;","function _arrayWithoutHoles(arr) {\n if (Array.isArray(arr)) {\n for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) {\n arr2[i] = arr[i];\n }\n\n return arr2;\n }\n}\n\nmodule.exports = _arrayWithoutHoles;","function _iterableToArray(iter) {\n if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === \"[object Arguments]\") return Array.from(iter);\n}\n\nmodule.exports = _iterableToArray;","function _nonIterableSpread() {\n throw new TypeError(\"Invalid attempt to spread non-iterable instance\");\n}\n\nmodule.exports = _nonIterableSpread;","var arrayWithoutHoles = require(\"./arrayWithoutHoles\");\n\nvar iterableToArray = require(\"./iterableToArray\");\n\nvar nonIterableSpread = require(\"./nonIterableSpread\");\n\nfunction _toConsumableArray(arr) {\n return arrayWithoutHoles(arr) || iterableToArray(arr) || nonIterableSpread();\n}\n\nmodule.exports = _toConsumableArray;","function _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot callLine truncated
+3 -3
View File
@@ -57,7 +57,7 @@ export default class Contextmenu {
if (menu.click) {
proxy($menu, 'click', event => {
event.preventDefault();
menu.click(event);
menu.click.call(this, event);
this.art.emit('contextmenu:click', $menu);
});
}
@@ -67,8 +67,8 @@ export default class Contextmenu {
.sort(
(a, b) =>
Number(a.dataset.artMenuId) - Number(b.dataset.artMenuId)
).forEach($menu => {
append(refs.$contextmenu, $menu);
).forEach(item => {
append(refs.$contextmenu, item);
});
append(refs.$player, refs.$contextmenu);
}
+13 -16
View File
@@ -7,23 +7,20 @@ export default class Danmu {
}
apply(art) {
const { events: { proxy }, danmu, i18n } = art;
this.$danmu = append(this.option.$control, icons.danmu);
this.$danmuClose = append(this.option.$control, icons.danmuClose);
const { $control } = this.option;
const { events: { proxy }, i18n, danmu } = art;
this.$danmu = append($control, icons.danmu);
tooltip(this.$danmu, i18n.get('Hide danmu'));
tooltip(this.$danmuClose, i18n.get('Show danmu'));
setStyle(this.$danmuClose, 'display', 'none');
proxy(this.$danmu, 'click', () => {
danmu.hide();
setStyle(this.$danmu, 'display', 'none');
setStyle(this.$danmuClose, 'display', 'flex');
});
proxy(this.$danmuClose, 'click', () => {
danmu.show();
setStyle(this.$danmu, 'display', 'flex');
setStyle(this.$danmuClose, 'display', 'none');
proxy($control, 'click', () => {
if (danmu.isOpen) {
danmu.hide();
setStyle(this.$danmu, 'opacity', '1');
tooltip(this.$danmu, i18n.get('Show danmu'));
} else {
danmu.show();
setStyle(this.$danmu, 'opacity', '0.8');
tooltip(this.$danmu, i18n.get('Hide danmu'));
}
});
}
}
+9 -9
View File
@@ -55,32 +55,32 @@ export default class Controls {
index: 30
}));
this.add(new Quality({
disable: this.art.option.quality.length === 0,
position: 'right',
index: 10
}));
this.add(new Danmu({
disable: false,
position: 'right',
index: 10
index: 20
}));
this.add(new Screenshot({
disable: !this.art.option.screenshot,
position: 'right',
index: 20
index: 30
}));
this.add(new Subtitle({
disable: !this.art.option.subtitle.url,
position: 'right',
index: 30
}));
this.add(new Quality({
disable: this.art.option.quality.length === 0,
position: 'right',
index: 40
}));
this.add(new Setting({
disable: false,
disable: !this.art.option.setting,
position: 'right',
index: 50
}));
+18 -1
View File
@@ -1,9 +1,26 @@
import { append, tooltip, setStyle } from '../utils';
import icons from '../icons';
export default class Setting {
constructor(option) {
this.option = option;
}
apply(art) {
this.art = art;
const { $control } = this.option;
const { events: { proxy }, i18n, setting } = art;
this.$setting = append($control, icons.setting);
tooltip(this.$setting, i18n.get('Show setting'));
proxy($control, 'click', () => {
if (setting.isOpen) {
setting.hide();
setStyle(this.$setting, 'opacity', '1');
tooltip(this.$setting, i18n.get('Show setting'));
} else {
setting.show();
setStyle(this.$setting, 'opacity', '0.8');
tooltip(this.$setting, i18n.get('Hide setting'));
}
});
}
}
+13 -16
View File
@@ -7,23 +7,20 @@ export default class Subtitle {
}
apply(art) {
const { events: { proxy }, subtitle, i18n } = art;
this.$subtitle = append(this.option.$control, icons.subtitle);
this.$subtitleClose = append(this.option.$control, icons.subtitleClose);
const { $control } = this.option;
const { events: { proxy }, i18n, subtitle } = art;
this.$subtitle = append($control, icons.subtitle);
tooltip(this.$subtitle, i18n.get('Hide subtitle'));
tooltip(this.$subtitleClose, i18n.get('Show subtitle'));
setStyle(this.$subtitleClose, 'display', 'none');
proxy(this.$subtitle, 'click', () => {
subtitle.hide();
setStyle(this.$subtitle, 'display', 'none');
setStyle(this.$subtitleClose, 'display', 'flex');
});
proxy(this.$subtitleClose, 'click', () => {
subtitle.show();
setStyle(this.$subtitle, 'display', 'flex');
setStyle(this.$subtitleClose, 'display', 'none');
proxy($control, 'click', () => {
if (subtitle.isOpen) {
subtitle.hide();
setStyle(this.$subtitle, 'opacity', '1');
tooltip(this.$subtitle, i18n.get('Show subtitle'));
} else {
subtitle.show();
setStyle(this.$subtitle, 'opacity', '0.8');
tooltip(this.$subtitle, i18n.get('Hide subtitle'));
}
});
}
}
+3
View File
@@ -3,6 +3,7 @@ import { setStyle } from './utils';
export default class Danmu {
constructor(art) {
this.art = art;
this.isOpen = true;
this.init();
}
@@ -13,6 +14,7 @@ export default class Danmu {
show() {
const { refs: { $danmu }, i18n, notice } = this.art;
setStyle($danmu, 'display', 'block');
this.isOpen = true;
notice.show(i18n.get('Show danmu'));
this.art.emit('danmu:show', $danmu);
}
@@ -20,6 +22,7 @@ export default class Danmu {
hide() {
const { refs: { $danmu }, i18n, notice } = this.art;
setStyle($danmu, 'display', 'none');
this.isOpen = false;
notice.show(i18n.get('Hide danmu'));
this.art.emit('danmu:hide', $danmu);
}
+6 -2
View File
@@ -19,7 +19,9 @@ let i18nMap = {
'Aspect ratio': '画面比例',
'Default': '默认',
'Normal': '正常',
'Switch': '切换'
'Switch': '切换',
'Hide setting': '隐藏设置',
'Show setting': '显示设置'
},
'zh-tw': {
'About author': '關於作者',
@@ -41,7 +43,9 @@ let i18nMap = {
'Aspect ratio': '畫面比例',
'Default': '默認',
'Normal': '正常',
'Switch': '切換'
'Switch': '切換',
'Hide setting': '隱藏設置',
'Show setting': '顯示設置'
}
};
-3
View File
@@ -1,3 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 60 60" style="width: 85%; height: 85%; opacity: .5">
<path d="M54,2.5H6c-3.252,0-6,2.748-6,6v33c0,3.252,2.748,6,6,6h14.555l8.702,9.669C29.446,57.38,29.717,57.5,30,57.5 s0.554-0.12,0.743-0.331l8.702-9.669H54c3.252,0,6-2.748,6-6v-33C60,5.248,57.252,2.5,54,2.5z M16,28.5c-2.206,0-4-1.794-4-4 s1.794-4,4-4s4,1.794,4,4S18.206,28.5,16,28.5z M30,28.5c-2.206,0-4-1.794-4-4s1.794-4,4-4s4,1.794,4,4S32.206,28.5,30,28.5z M44,28.5c-2.206,0-4-1.794-4-4s1.794-4,4-4s4,1.794,4,4S46.206,28.5,44,28.5z"/>
</svg>

Before

Width:  |  Height:  |  Size: 549 B

+2 -4
View File
@@ -5,10 +5,9 @@ import pause from './pause.svg';
import volume from './volume.svg';
import volumeClose from './volume-close.svg';
import subtitle from './subtitle.svg';
import subtitleClose from './subtitle-close.svg';
import screenshot from './screenshot.svg';
import danmu from './danmu.svg';
import danmuClose from './danmu-close.svg';
import setting from './setting.svg';
const icons = {
loading,
@@ -18,10 +17,9 @@ const icons = {
volume,
volumeClose,
subtitle,
subtitleClose,
screenshot,
danmu,
danmuClose
setting
};
function creatDomFromSvg(map) {
+4
View File
@@ -0,0 +1,4 @@
<svg xmlns="http://www.w3.org/2000/svg" style="width: 100%; height: 100%" viewBox="0 0 22 22">
<circle cx="11" cy="11" r="2"></circle>
<path d="M19.164 8.861L17.6 8.6a6.978 6.978 0 0 0-1.186-2.099l.574-1.533a1 1 0 0 0-.436-1.217l-1.997-1.153a1.001 1.001 0 0 0-1.272.23l-1.008 1.225a7.04 7.04 0 0 0-2.55.001L8.716 2.829a1 1 0 0 0-1.272-.23L5.447 3.751a1 1 0 0 0-.436 1.217l.574 1.533A6.997 6.997 0 0 0 4.4 8.6l-1.564.261A.999.999 0 0 0 2 9.847v2.306c0 .489.353.906.836.986l1.613.269a7 7 0 0 0 1.228 2.075l-.558 1.487a1 1 0 0 0 .436 1.217l1.997 1.153c.423.244.961.147 1.272-.23l1.04-1.263a7.089 7.089 0 0 0 2.272 0l1.04 1.263a1 1 0 0 0 1.272.23l1.997-1.153a1 1 0 0 0 .436-1.217l-.557-1.487c.521-.61.94-1.31 1.228-2.075l1.613-.269a.999.999 0 0 0 .835-.986V9.847a.999.999 0 0 0-.836-.986zM11 15a4 4 0 1 1 0-8 4 4 0 0 1 0 8z"></path>
</svg>

After

Width:  |  Height:  |  Size: 843 B

-4
View File
@@ -1,4 +0,0 @@
<svg style="width: 100%; height: 100%; opacity: .5" viewBox="0 0 48 48" xmlns="http://www.w3.org/2000/svg">
<path d="M0 0h48v48H0z" fill="none"/>
<path d="M40 8H8c-2.21 0-4 1.79-4 4v24c0 2.21 1.79 4 4 4h32c2.21 0 4-1.79 4-4V12c0-2.21-1.79-4-4-4zM8 24h8v4H8v-4zm20 12H8v-4h20v4zm12 0h-8v-4h8v4zm0-8H20v-4h20v4z"/>
</svg>

Before

Width:  |  Height:  |  Size: 327 B

+3
View File
@@ -19,6 +19,7 @@ import Layers from './layers';
import Loading from './loading';
import Notice from './notice';
import Mask from './mask';
import Setting from './setting';
let id = 0;
export const instances = [];
@@ -66,6 +67,7 @@ class Artplayer extends Emitter {
quality: [],
loading: '',
theme: '#f00',
setting: true,
hotkey: true,
pip: true,
fullscreen: true,
@@ -125,6 +127,7 @@ class Artplayer extends Emitter {
this.loading = new Loading(this);
this.hotkey = new Hotkey(this);
this.mask = new Mask(this);
this.setting = new Setting(this);
this.id = id++;
instances.push(this);
+2 -1
View File
@@ -41,8 +41,9 @@ export default {
}
},
contextmenu: {
type: 'array|function',
type: 'array',
child: {
type: 'object|function',
name: 'string',
html: {
validator: validElement
+37
View File
@@ -0,0 +1,37 @@
import { setStyle } from './utils';
export default class Setting {
constructor(art) {
this.art = art;
this.isOpen = false;
this.init();
}
init() {
//
}
add() {
//
}
switch(name) {
console.log(name);
}
show() {
const { refs: { $setting }, i18n, notice } = this.art;
setStyle($setting, 'display', 'flex');
this.isOpen = true;
notice.show(i18n.get('Show setting'));
this.art.emit('setting:show', $setting);
}
hide() {
const { refs: { $setting }, i18n, notice } = this.art;
setStyle($setting, 'display', 'none');
this.isOpen = false;
notice.show(i18n.get('Hide setting'));
this.art.emit('setting:hide', $setting);
}
}
+4
View File
@@ -129,6 +129,7 @@
height: 36px;
.art-control {
opacity: .9;
float: left;
font-size: 12px;
height: 36px;
@@ -142,6 +143,9 @@
width: 36px;
padding: 7px;
}
&:hover {
opacity: 1;
}
}
.art-control-volume {
+1
View File
@@ -8,5 +8,6 @@ import './loading.scss';
import './bottom.scss';
import './notice.scss';
import './contextmenu.scss';
import './setting.scss';
import './info.scss';
import './aspectRatio.scss';
+1 -1
View File
@@ -4,7 +4,7 @@
position: absolute;
left: 10px;
top: 10px;
z-index: 90;
z-index: 100;
width: 350px;
min-height: 150px;
padding: 10px;
+24
View File
@@ -0,0 +1,24 @@
.artplayer-video-player {
.artplayer-setting {
display: none;
font-size: 14px;
position: absolute;
z-index: 90;
left: 0;
top: 0;
height: 100%;
width: 100%;
align-items: center;
justify-content: center;
pointer-events: none;
.artplayer-setting-inner {
width: 350px;
height: 250px;
padding: 10px;
color: #fff;
background: rgba(0, 0, 0, 0.6);
border-radius: 3px;
pointer-events: all;
}
}
}
+3 -1
View File
@@ -3,7 +3,7 @@ import { errorHandle, getExt, setStyles, setStyle } from './utils';
export default class Subtitle {
constructor(art) {
this.art = art;
this.isOpen = true;
const { url } = this.art.option.subtitle;
if (url) {
this.checkExt(url);
@@ -92,6 +92,7 @@ export default class Subtitle {
show() {
const { refs: { $subtitle }, i18n, notice } = this.art;
setStyle($subtitle, 'display', 'block');
this.isOpen = true;
notice.show(i18n.get('Show subtitle'));
this.art.emit('subtitle:show', $subtitle);
}
@@ -99,6 +100,7 @@ export default class Subtitle {
hide() {
const { refs: { $subtitle }, i18n, notice } = this.art;
setStyle($subtitle, 'display', 'none');
this.isOpen = false;
notice.show(i18n.get('Hide subtitle'));
this.art.emit('subtitle:hide', $subtitle);
}
+5
View File
@@ -24,6 +24,9 @@ export default class Template {
<div class="artplayer-notice">
<div class="artplayer-notice-inner"></div>
</div>
<div class="artplayer-setting">
<div class="artplayer-setting-inner"></div>
</div>
<div class="artplayer-info">
<div class="artplayer-info-panel"></div>
<div class="artplayer-info-close">[x]</div>
@@ -44,6 +47,8 @@ export default class Template {
refs.$notice = refs.$container.querySelector('.artplayer-notice');
refs.$noticeInner = refs.$container.querySelector('.artplayer-notice-inner');
refs.$mask = refs.$container.querySelector('.artplayer-mask');
refs.$setting = refs.$container.querySelector('.artplayer-setting');
refs.$settingInner = refs.$container.querySelector('.artplayer-setting-inner');
refs.$info = refs.$container.querySelector('.artplayer-info');
refs.$infoPanel = refs.$container.querySelector('.artplayer-info-panel');
refs.$infoClose = refs.$container.querySelector('.artplayer-info-close');