Comments on: Support Video for All Browsers by Adding MediaElement.js to Hana Flv Player http://wpmarketing.org/2012/05/support-video-for-all-browsers-by-adding-mediaelement-js-to-hana-flv-player/ Wordpress for Internet and Affiliate Marketing Wed, 01 Apr 2015 12:48:19 +0000 hourly 1 https://wordpress.org/?v=4.6.6 By: HanaDaddy http://wpmarketing.org/2012/05/support-video-for-all-browsers-by-adding-mediaelement-js-to-hana-flv-player/comment-page-1/#comment-105602 Mon, 04 Jun 2012 21:20:36 +0000 http://wpmarketing.org/?p=680#comment-105602 Hello, in fact , it appears there is a way to do this.
Here is a sample snippet that plays video at 15 seconds and stops at 20 seconds. It works pretty good with HTML5 but have some issues with fallback flash player.

By the way, I don’t have a plan to implement this kind of feature in to my “Hana Flv Plugin” yet.

<video width="480" height="320" id="player1" src="http://wpmarketing.org/video/echo-hereweare.mp4"  controls="controls"></video>
<script>
$('#player1').mediaelementplayer({
    success: function (mediaElement, domObject) {
 
        mediaElement.addEventListener('loadedmetadata', function(e){
            mediaElement.setCurrentTime(15);
 
        }, false);
        mediaElement.addEventListener('timeupdate', function(e) {
            if(mediaElement.currentTime >= 20) {
                mediaElement.pause();
            }
            //show the current play time in the div.
            $('#current-time').html(mediaElement.currentTime);
        }, false);
    }
});
</script>
<div id='current-time'></div>
]]>
By: Peter http://wpmarketing.org/2012/05/support-video-for-all-browsers-by-adding-mediaelement-js-to-hana-flv-player/comment-page-1/#comment-105485 Sun, 03 Jun 2012 17:33:11 +0000 http://wpmarketing.org/?p=680#comment-105485 Hi HanaDaddy,

Is there a way to play just a clip of a video file, i.e. specify start and end time. Preferably with MediaElement.js.

Thanks,

Peter

]]>