video.js - Video JS - Change Play Icon in ControlBar with Replay Icon After Video End -


i have videojs player. want chage play icon in controlbar replay icon when video has end. can see youtube player :

enter image description here

this code :

<script>  videojs("my_video_1").ready(function(){    var vid = this;  vid.on("ended", function(){  alert ("i want change play icon in cotrolbar replay icon");   // dont know chage play icon when video finish    });    });

this full code. can run via jsbin: http://jsbin.com/fijefi/2/

thank you

you don't need javascript this. can change play icon via css.

in default less file there 2 states play button:

.vjs-default-skin .vjs-play-control:before {   content: @play-icon; } .vjs-default-skin.vjs-playing .vjs-play-control:before {   content: @pause-icon; } 

you need add third state when video has ended. there css class that. you'll end looks like:

.vjs-default-skin.vjs-ended .vjs-play-control:before {    content: "your reply icon";  } 

Comments

Popular posts from this blog

apache - PHP Soap issue while content length is larger -

asynchronous - Python asyncio task got bad yield -

javascript - Complete OpenIDConnect auth when requesting via Ajax -