I need to override "features" attribute of mediaelements.js component. The scenario is this: - start first promotional video with small control (only volume) - when video is ended, content video starts and more control must be shown.
This the code:
<video width="640" height="360" src="promo.mp4" type="video/mp4"
id="player1" poster="../media/echo-hereweare.jpg"
controls="controls" preload="true"></video>
<script>
$(function () {
promoVideo();
});
function promoVideo() {
$("#player1").mediaelementplayer({
features: ['volume'],
success: function(player, node) {
// add event listener
player.addEventListener('ended', function(e) {
contentVideo(e.target);
}, false);
}
});
}
function contentVideo(player) {
var contentVideoSrc = "content.mp4";
player.features = ['playpause','progress','fullscreen','current','duration'];
player.pause();
player.setSrc(contentVideoSrc);
player.play();
}
</script>
With this code, the promo video starts and have only volume control. When ended, start the content video correctly but the other controls set in "features" attribute don't appear. I have also to add the features in this way:
$("#player1").mediaelementplayer({
features: ['playpause','progress','fullscreen','current','duration']
});
and this:
var player = new MediaElementPlayer(
"#player1"
,
{
features: ['playpause','progress','fullscreen','current','duration']
}
);
But in all case not work. Any suggestion?
Thanks! Giuseppe