!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports["video/player/seek-by-frames"]=t():e["video/player/seek-by-frames"]=t()}(self,(function(){return function(){"use strict";var e,t,r={730:function(e){e.exports=coreApis.componentApis.video.playerAgent}},n={};function o(e){var t=n[e];if(void 0!==t)return t.exports;var a=n[e]={exports:{}};return r[e](a,a.exports,o),a.exports}t=Object.getPrototypeOf?function(e){return Object.getPrototypeOf(e)}:function(e){return e.__proto__},o.t=function(r,n){if(1&n&&(r=this(r)),8&n)return r;if("object"==typeof r&&r){if(4&n&&r.__esModule)return r;if(16&n&&"function"==typeof r.then)return r}var a=Object.create(null);o.r(a);var i={};e=e||[null,t({}),t([]),t(t)];for(var s=2&n&&r;"object"==typeof s&&!~e.indexOf(s);s=t(s))Object.getOwnPropertyNames(s).forEach((function(e){i[e]=function(){return r[e]}}));return i.default=function(){return r},o.d(a,i),a},o.d=function(e,t){for(var r in t)o.o(t,r)&&!o.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var a={};return function(){o.d(a,{component:function(){return c}});var e=coreApis.componentApis.video.videoControlBar,t=coreApis.observer,r=coreApis.utils,n=coreApis.utils.urls,i=coreApis.pluginApis.data;const s="seek-by-frame-disable",c={name:"seekByFrames",displayName:"启用逐帧调整",tags:[componentsTags.video],description:{"zh-CN":"在播放器的时间右边增加两个按钮, 用于**较精细**调整视频时间. 支持键盘快捷键Shift+/.\r\n\r\n> 注: `视频的实际播放帧率`跟`视频本身的帧率`和`显示器的刷新率`有关, 很难计算一个精准的数值, 部分视频仍然会有暂停不到那种一闪而过的图的情况."},entry:async()=>{await(0,r.playerReady)();const{playerAgent:n}=await Promise.resolve().then(o.t.bind(o,730,23));(0,i.addData)("ui.icons",(e=>{e["seek-left"]='\r\n\x3c!-- Generator: Adobe Illustrator 24.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) --\x3e\r\n\r\n\r\n\t\r\n\r\n\r\n\r\n',e["seek-right"]='\r\n\x3c!-- Generator: Adobe Illustrator 24.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) --\x3e\r\n\r\n\r\n\t\r\n\r\n\r\n\r\n'}));let a=0;(0,t.attributesSubtree)(`${n.query.control.buttons.quality.selector} ul`,(()=>{const e=dq(`${n.query.control.buttons.quality.selector} .bui-select-item-active, ${n.query.control.buttons.quality.selector} .active`),t=e?parseInt(e.getAttribute("data-value")):0,r=(()=>{switch(t){case 116:case 74:return 6e4/1001;default:return 3e4/1001}})();a=1/r}));const s=e=>{n.changeTime(e*a)};(0,e.addControlBarButton)({name:"seekPrevFrame",displayName:"上一帧",icon:"seek-left",order:1,action:()=>{s(-1)}}),(0,e.addControlBarButton)({name:"seekNextFrame",displayName:"下一帧",icon:"seek-right",order:2,action:()=>{s(1)}})},reload:()=>document.body.classList.remove(s),unload:()=>document.body.classList.add(s),urlInclude:n.playerUrls,plugin:{displayName:"逐帧调整 - 快捷键支持",setup:()=>{(0,i.addData)("keymap.actions",(e=>{e.previousFrame={displayName:"上一帧",run:e=>{const{clickElement:t}=e;return t('.be-video-control-bar-extend [data-name="seekPrevFrame"]',e)}},e.nextFrame={displayName:"下一帧",run:e=>{const{clickElement:t}=e;return t('.be-video-control-bar-extend [data-name="seekNextFrame"]',e)}}})),(0,i.addData)("keymap.presets",(e=>{e.previousFrame="shift arrowLeft",e.nextFrame="shift arrowRight"}))}}}}(),a=a.component}()}));