MCPcopy Index your code
hub / github.com/hoothin/UserScripts / contentScript

Function contentScript

FlashViewer-HTML5 Video/flashViewer.user.js:50–3908  ·  view source on GitHub ↗
(messageID)

Source from the content-addressed store, hash-verified

48 }
49
50 function contentScript(messageID) {
51 'use strict';
52
53 // console.log(messageID);
54
55 // 选项
56 var prefs = {
57 // 是否允许按照一定规则重新初始化flash让你获得允许flash全屏,开关自动播放,允许跳转回主页观看等等功能
58 allowReinitFlash: true,
59 // 浮动工具栏相关设置.
60 floatBar: {
61 // 按钮排列顺序'pop'(弹出视频),'reload'(重载视频),'close'(关闭视频然后显示占位符(点击占位符的关闭彻底移除视频))
62 // 不想显示的按钮,就不要填,比如改成 ['pop','reload'] 之后 'close'按钮就不会显示了
63 butonOrder: ['pop','reload','close'],
64 // 浮动工具栏显示延时.单位(毫秒)
65 showDelay: 366,
66 // 取值为: 'top left'(左上角) 或者 'top right'(右上角) 'bottom right'(右下角) 'bottom left'(左下角);
67 position: 'top left',
68 //浮动工具栏偏移.单位(像素)
69 offset: {
70 // x轴偏移(正值,向右偏移,负值向左)
71 x: -15,
72 // y轴偏移(正值,向下,负值向上)
73 y: -25,
74 },
75 // 当摸到的视频大于等于设定尺寸的时候才显示悬浮工具栏(用来过滤一些非视频类的flash插件)
76 minSizeLimit: {
77 height: 100,
78 width: 100,
79 },
80 },
81 // 弹出的视频相关设置
82 popVideo: {
83 // 弹出视频后默认关灯
84 lightOff: {
85 enabled: false,
86 // 0.01-1.00之间,数字越大越暗。
87 opacity: 0.95,
88 } ,
89 // 默认钉住,position fixed效果。
90 pin: false,
91 // 默认最大化
92 maximize: false,
93 },
94 };
95
96
97 // 按照规则重载object 和 embed标签引用的flash插件
98 var rules = [
99 {name: '优酷外链',// 给这条规则取个名字,方便自己修改的时候方便
100 // 匹配youku外链播放器的正则表达式
101 url: /^https?:\/\/(?:static|player)\.youku\.com\/.+/i,
102 // 是否让这条规则生效
103 enabled: true,
104 // 不生效的页面,比如优酷自己的网站上引用的视频。
105 excludes: /^https?:\/\/(?:www|v)\.youku\.com\//i,
106 // 允许flash全屏['true'|'false']
107 // 如果你想外链的视频的全屏播放功能生效,请设置为'true'

Callers

nothing calls this directly

Calls 15

dataFunction · 0.85
getCurFunction · 0.85
genFxFunction · 0.85
eachFunction · 0.85
nowFunction · 0.85
reinitFlashFunction · 0.85
reizeFunction · 0.85
fitScreenFunction · 0.85
reinitPluginFunction · 0.85
convertFVars2ObjFunction · 0.85
containsMethod · 0.80
removeMethod · 0.80

Tested by

no test coverage detected