2014-10-19 10:12:20 +00:00
|
|
|
$(function() {
|
|
|
|
|
|
|
|
$('video').mediaelementplayer({
|
2014-10-19 18:04:53 +00:00
|
|
|
mode: 'auto_plugin',
|
2014-10-19 10:12:20 +00:00
|
|
|
usePluginFullScreen: true,
|
|
|
|
enableAutosize: true,
|
|
|
|
|
2014-10-19 18:04:53 +00:00
|
|
|
pluginPath: 'assets/js/lib/',
|
|
|
|
features: ['playpause', 'volume','fullscreen']
|
2014-10-19 10:12:20 +00:00
|
|
|
});
|
|
|
|
$('audio').mediaelementplayer();
|
|
|
|
|
|
|
|
// activate tab via hash and default to video
|
|
|
|
function setTabToHash() {
|
|
|
|
var activeTab = $('.nav-tabs a[href=' + window.location.hash + ']').tab('show');
|
|
|
|
}
|
|
|
|
|
|
|
|
// change hash on tab change
|
|
|
|
$('.nav-tabs').on('shown.bs.tab', 'a', function (e) {
|
|
|
|
window.location.hash = e.target.hash;
|
|
|
|
});
|
|
|
|
|
|
|
|
// adjust tabs when hash changes
|
2014-10-20 19:20:08 +00:00
|
|
|
$(window).on('hashchange', setTabToHash).trigger('hashchange');
|
|
|
|
|
2014-10-20 19:39:54 +00:00
|
|
|
$('.click-to-irc').on('click', function(e) {
|
|
|
|
if($(this).hasClass('activating'))
|
|
|
|
return;
|
|
|
|
|
|
|
|
if($(e.target).hasClass('irclink'))
|
|
|
|
return;
|
|
|
|
|
2014-10-20 19:20:08 +00:00
|
|
|
var
|
2014-10-20 19:39:54 +00:00
|
|
|
$irc = $(this).addClass('activating'),
|
2014-10-20 19:20:08 +00:00
|
|
|
$iframe = $(this).find('iframe');
|
|
|
|
|
|
|
|
$iframe.on('load', function() {
|
|
|
|
$irc.addClass('active');
|
|
|
|
}).attr('src', $iframe.data('src'));
|
|
|
|
});
|
2014-10-19 10:12:20 +00:00
|
|
|
});
|