i randomly facing error. video loads fine shows updatesrc not function. video loads on page refresh. have tried couldn't fix if can me great.
html
<video id="<?php echo $id; ?>" class="video-js vjs-16-9 vjs-big-play-centered" controls preload="auto" width="100%" height="100%" poster="<?php echo (isset($mposter))?$mposter:'';?>" data-setup="{}"> <p class="vjs-no-js"> view video please enable javascript, , consider upgrading web browser <a href="http://videojs.com/html5-video-support/" target="_blank">supports html5 video</a> </p> </video>
javascript
var videoplayer = videojs('<?php echo $id; ?>', { plugins: { videojsresolutionswitcher: { default: 480, dynamiclabel: true } } }, function() { this.updatesrc(<?php echo (isset($code))?$code:'';?>) this.preload(false) this.on('resolutionchange', function() { console.info('source changed %s', this.src()) }) this.autoplay(true) });
error
found fix dynamically generating video tag. here code:
var videotaghtml= "<video id='<?php echo $id; ?>' class='video-js vjs-16-9 vjs-big-play-centered'"+ " controls preload='auto' width='100%' height='100%' poster='<?php echo (isset($mposter))?$mposter:'';?>'"+ "data-setup=\"{}\">"+ "<p class=\"vjs-no-js\">"+ "to view video please enable javascript, , consider upgrading web browser that"+ "<a href=\"http://videojs.com/html5-video-support/\" target=\"_blank\">supports html5 video</a>"+ "</p>"+ +"</video>"; $( "#videotag" ).append(videotaghtml);
Comments
Post a Comment