streaming-website/assets/js/lustiges-script.js

42 lines
980 B
JavaScript
Raw Normal View History

$(function() {
$('video').mediaelementplayer({
mode: 'auto_plugin',
usePluginFullScreen: true,
enableAutosize: true,
pluginPath: 'assets/js/lib/',
features: ['playpause', 'volume','fullscreen']
});
$('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'));
});
});