dynamicbg
Dynamic background Gaussian blur rendering plugin。SourceCode
pluginName: dynamicbg
The plugin is disable by default,The following configuration of playerConfig is required for opening
const player = new Player({
...,
dynamicBg: {
disable: false
}
})
The plug-in display effect is shown in the figure below:

Note
- If the video.src under safari is blob type or the video is encrypted type,video frame cannot be captured, so we will be downgraded to use the
playerConfig.posterimage as the background - Before the first frame of the video is loaded,Will get
playerConfig.posterto display the background - The video playback address must support cross-domain
config
isInnerRender
@type:Booleandefault:false
Whether to render only in the display area of the video screen, If true is selected, when the control bar is separated from the video screen, the position of the control bar will not be rendered
disable
@type:Booleandefault:true
mode
@type:Stringdefault:framerateThe specific enumeration values are as follows:
framerateDynamic rendering according to the frame rate,frame rate value isframeRaterealtimeReal-time rendering, with the highest rendering frequencyfirstframeRender only the first frame
frameRate
@type:Numberdefault:10
The frame rate is rendered when framed,,Only effective when mode:framerate
filter
@type:Stringdefault:blur(50px)
Background Gaussian Blur Filter Settings
addMask
@type:Booleandefault:true
Do you need a transparency mask
maskBg
@type:Stringdefault:rgba(0,0,0,0.7)
Mask color configuration, only effective when addMask is true
multiple
@type:numberdefault:1.2
The multiple of the screen magnification when rendering
API
isSupport
@desc: static API, Check whether the current environment supports rendering
import { DynamicBg } from 'xgplayer/es/plugins/dynamicBg'
const support = DynamicBg.isSupport()
start()
@desc: Start rendering
stop()
@desc: Stop rendering
updateImg(url)
@desc: Use a picture url to render once@param:{ String } url