(function () { function htmlMediaRenderer(type) { var mediaElement; var self = this; function onEnded() { $(self).trigger('ended'); } function onTimeUpdate() { $(self).trigger('timeupdate'); } function onVolumeChange() { $(self).trigger('volumechange'); } function onOneAudioPlaying() { $('.mediaPlayerAudioContainer').hide(); } function onPlaying() { $(self).trigger('playing'); } function onPlay() { $(self).trigger('play'); } function onPause() { $(self).trigger('pause'); } function onClick() { $(self).trigger('click'); } function onDblClick() { $(self).trigger('dblclick'); } function onError() { var errorCode = this.error ? this.error.code : ''; console.log('Media element error code: ' + errorCode); $(self).trigger('error'); } function onLoadedMetadata() { // The IE video player won't autoplay without this if ($.browser.msie) { this.play(); } } function onOneVideoPlaying() { var requiresNativeControls = !MediaPlayer.enableCustomVideoControls(); if (requiresNativeControls) { $(this).attr('controls', 'controls'); } var currentSrc = (this.currentSrc || '').toLowerCase(); var parts = currentSrc.split('#'); if (parts.length > 1) { parts = parts[parts.length - 1].split('='); if (parts.length == 2) { var startPositionInSeekParam = parseFloat(parts[1]); // Appending #t=xxx to the query string doesn't seem to work with HLS if (startPositionInSeekParam && currentSrc.indexOf('.m3u8') != -1) { var element = this; setTimeout(function () { element.currentTime = startPositionInSeekParam; }, 3000); } } } } function createAudioElement() { var elem = $('.mediaPlayerAudio'); if (!elem.length) { var html = ''; var requiresControls = !MediaPlayer.canAutoPlayAudio(); if (requiresControls) { html += '