txt
overlay text
img
image URL
video
video URL (MP4 or Webm)
width
video width (number of pixels)
start
time (seconds number) to start overlay display.
duration
overlay display time (seconds). If not defined, overlay will stay o top to the end of the main video.
position
default position value is top-left.
Other posssible position values are: top-center, top-right, center, center-left, center-right, bottom-left, bottom-center, bottom-right.
Other posssible position values are: top-center, top-right, center, center-left, center-right, bottom-left, bottom-center, bottom-right.
offsetX
offset from the left or right side (pixels or percent), default:
0px.
offsetY
offset from the top side (pixels or percent), default:
0px
fontSize
font size (text only), default: 16px.
fontWeight
font weight (text only), default:
normal.
fontStyle
allows to change fontStyle CSS property
undefined
fontFamily
font family (text only), default:
sans-serif
color
font color (text only), default:
white
background
background color (text only), default:
black
border
border color (image and video), default:
transparent
close
close button (image and video), default:
false
url
optional URL to go when the user clcik or touch on image/video overlay.
The most simple single text overlay setup code to insert after the player and nuevo plugin initialization code is like:
Code snippet
<script src="/path/to/videojs/plugins/overlay.js"></script><script>player.overlay({txt: "This is my overlay text",start:5,duration: 20position: "top-right"});</script>Code snippet
<script src="/path/to/videojs/overlay.js"></script><script src="/path/to/videojs/nuevo.min.js"></script><script src="/path/to/videojs/plugins/overlay.js"></script><script>const player = videojs("veoplayer", {license: "key"});player.nuevo({contextMenu:false});player.overlay([{txt:"Overlay text at the top-left position",start:2,duration:8},{txt:"Overlay text at the bottom-right position.",position:"bottom-right",background:"#C00",start:3,duration:7},{txt:"Overlay text at the top-right position.",position:"top-right",background:"gold",color:"black",start:4,duration:6},{txt:"Overlay text at the bottom-right position.",position:"bottom-right",background:"cyan",color:"black",start:5,duration:5},{img:"//images/overlay.jpg",url:'//www.nuevodevel.com/nuevo/order',start:10,duration:7,position:"center",border:"white",close:true},{txt:"This is final overlay text at the top-center position",position:"top-center",background:"#0C0",start:17,duration:7},{video:"//video/overlay.mp4",close:true,start:18,position:"center-right",offsetX:10,border:"#ccc"},]);<script>This is possible to create and display new overlay object during video playback at any time programmatically.
Code snippet
<script>player.overlay.new({txt:"Overlay text at top-center position",position:"top-center",duration:20});<script>The overlay plugin is included in all three available plans of the software offered by NuevoDevel.com