jellyfin-web/dashboard-ui/scripts/mediaplayer-video.js

1269 lines
44 KiB
JavaScript
Raw Normal View History

(function () {
2014-06-21 22:52:31 -07:00
function createVideoPlayer(self) {
var initialVolume;
var idleState = true;
var muteButton = null;
var unmuteButton = null;
var volumeSlider = null;
var positionSlider;
var currentTimeElement;
2014-06-11 12:31:33 -07:00
self.currentSubtitleStreamIndex = null;
2014-06-11 19:38:40 -07:00
self.getCurrentSubtitleStream = function () {
return self.getSubtitleStream(self.currentSubtitleStreamIndex);
};
self.getSubtitleStream = function (index) {
return self.currentMediaSource.MediaStreams.filter(function (s) {
return s.Type == 'Subtitle' && s.Index == index;
})[0];
};
self.toggleFullscreen = function () {
if (self.isFullScreen()) {
2015-05-17 18:27:48 -07:00
self.exitFullScreen();
} else {
requestFullScreen(document.body);
}
};
self.resetEnhancements = function () {
2015-08-28 12:10:44 -07:00
2015-11-27 17:04:04 -07:00
if (!initComplete) {
return;
}
2015-11-27 18:18:15 -07:00
if (self.isFullScreen()) {
self.exitFullScreen();
}
fadeOut(document.querySelector('#videoPlayer'));
2014-10-09 15:22:04 -07:00
$('#videoPlayer').removeClass('fullscreenVideo').removeClass('idlePlayer');
2014-06-28 12:35:30 -07:00
$('.hiddenOnIdle').removeClass("inactive");
$("video").remove();
2015-08-28 12:10:44 -07:00
document.querySelector('.mediaButton.infoButton').classList.remove('active');
document.querySelector('.videoControls .nowPlayingInfo').classList.add('hide');
document.querySelector('.videoControls').classList.add('hiddenOnIdle');
};
2014-03-20 20:31:40 -07:00
self.exitFullScreen = function () {
2015-05-17 18:27:48 -07:00
if (document.exitFullscreen) {
document.exitFullscreen();
2015-05-27 22:51:48 -07:00
} else if (document.mozCancelFullScreen) {
document.mozCancelFullScreen();
} else if (document.webkitExitFullscreen) {
document.webkitExitFullscreen();
2015-05-17 18:27:48 -07:00
} else if (document.msExitFullscreen) {
document.msExitFullscreen();
}
2014-05-29 12:34:20 -07:00
$('#videoPlayer').removeClass('fullscreenVideo');
2014-03-17 07:48:16 -07:00
};
2014-03-20 20:31:40 -07:00
self.isFullScreen = function () {
return document.fullscreen || document.mozFullScreen || document.webkitIsFullScreen || document.msFullscreenElement ? true : false;
2014-03-17 07:48:16 -07:00
};
2015-05-21 13:53:14 -07:00
self.showSubtitleMenu = function () {
2015-06-27 12:53:36 -07:00
var streams = self.currentMediaSource.MediaStreams.filter(function (currentStream) {
return currentStream.Type == "Subtitle";
});
2015-05-21 13:53:14 -07:00
2015-12-17 09:21:21 -07:00
var currentIndex = self.currentSubtitleStreamIndex;
if (currentIndex == null) {
currentIndex = -1;
}
2015-06-27 12:53:36 -07:00
streams.unshift({
Index: -1,
2015-12-17 09:21:21 -07:00
Language: Globalize.translate('ButtonOff')
2015-06-27 12:53:36 -07:00
});
var menuItems = streams.map(function (stream) {
var attributes = [];
attributes.push(stream.Language || Globalize.translate('LabelUnknownLanguage'));
if (stream.Codec) {
attributes.push(stream.Codec);
}
var name = attributes.join(' - ');
if (stream.IsDefault) {
name += ' (D)';
}
if (stream.IsForced) {
name += ' (F)';
}
if (stream.External) {
name += ' (EXT)';
}
var opt = {
name: name,
id: stream.Index
};
if (stream.Index == currentIndex) {
opt.ironIcon = "check";
}
return opt;
});
require(['actionsheet'], function () {
ActionSheetElement.show({
items: menuItems,
positionTo: $('.videoSubtitleButton')[0],
callback: function (id) {
var index = parseInt(id);
if (index != currentIndex) {
self.onSubtitleOptionSelected(index);
}
}
});
2015-06-27 12:53:36 -07:00
});
};
2015-05-21 13:53:14 -07:00
self.showQualityFlyout = function () {
require(['qualityoptions', 'actionsheet'], function (qualityoptions) {
var currentSrc = self.getCurrentSrc(self.currentMediaRenderer).toLowerCase();
var isStatic = currentSrc.indexOf('static=true') != -1;
2015-06-27 12:53:36 -07:00
var videoStream = self.currentMediaSource.MediaStreams.filter(function (stream) {
return stream.Type == "Video";
})[0];
var videoWidth = videoStream ? videoStream.Width : null;
2015-06-27 12:53:36 -07:00
var options = qualityoptions.getVideoQualityOptions(AppSettings.maxStreamingBitrate(), videoWidth);
2015-06-27 12:53:36 -07:00
if (isStatic) {
options[0].name = "Direct";
}
2015-06-27 12:53:36 -07:00
var menuItems = options.map(function (o) {
2015-06-27 12:53:36 -07:00
var opt = {
name: o.name,
id: o.bitrate
};
if (o.selected) {
opt.ironIcon = "check";
}
2015-06-27 12:53:36 -07:00
return opt;
});
2015-06-27 12:53:36 -07:00
var selectedId = options.filter(function (o) {
return o.selected;
});
selectedId = selectedId.length ? selectedId[0].bitrate : null;
2015-06-27 12:53:36 -07:00
ActionSheetElement.show({
items: menuItems,
positionTo: $('.videoQualityButton')[0],
callback: function (id) {
var bitrate = parseInt(id);
if (bitrate != selectedId) {
self.onQualityOptionSelected(bitrate);
}
}
});
});
};
self.showAudioTracksFlyout = function () {
2015-06-27 12:53:36 -07:00
var options = self.currentMediaSource.MediaStreams.filter(function (currentStream) {
return currentStream.Type == "Audio";
});
2015-05-21 13:53:14 -07:00
2015-06-27 12:53:36 -07:00
var currentIndex = getParameterByName('AudioStreamIndex', self.getCurrentSrc(self.currentMediaRenderer));
var menuItems = options.map(function (stream) {
var attributes = [];
attributes.push(stream.Language || Globalize.translate('LabelUnknownLanguage'));
if (stream.Codec) {
attributes.push(stream.Codec);
}
if (stream.Profile) {
attributes.push(stream.Profile);
}
if (stream.BitRate) {
attributes.push((Math.floor(stream.BitRate / 1000)) + ' kbps');
}
if (stream.Channels) {
attributes.push(stream.Channels + ' ch');
}
var name = attributes.join(' - ');
if (stream.IsDefault) {
name += ' (D)';
}
var opt = {
name: name,
id: stream.Index
};
if (stream.Index == currentIndex) {
opt.ironIcon = "check";
}
return opt;
});
require(['actionsheet'], function () {
ActionSheetElement.show({
items: menuItems,
positionTo: $('.videoAudioButton')[0],
callback: function (id) {
2015-06-27 12:53:36 -07:00
var index = parseInt(id);
if (index != currentIndex) {
self.onAudioOptionSelected(index);
}
}
});
});
};
2014-05-07 22:04:39 -07:00
self.setAudioStreamIndex = function (index) {
self.changeStream(self.getCurrentTicks(), { AudioStreamIndex: index });
};
self.setSubtitleStreamIndex = function (index) {
2014-06-11 19:38:40 -07:00
2015-06-13 07:46:59 -07:00
if (!self.currentMediaRenderer.supportsTextTracks()) {
2014-07-19 21:46:29 -07:00
2014-06-11 19:38:40 -07:00
self.changeStream(self.getCurrentTicks(), { SubtitleStreamIndex: index });
self.currentSubtitleStreamIndex = index;
return;
}
var currentStream = self.getCurrentSubtitleStream();
var newStream = self.getSubtitleStream(index);
if (!currentStream && !newStream) return;
var selectedTrackElementIndex = -1;
if (currentStream && !newStream) {
2015-03-30 12:57:37 -07:00
if (currentStream.DeliveryMethod != 'External') {
2014-06-11 19:38:40 -07:00
// Need to change the transcoded stream to remove subs
self.changeStream(self.getCurrentTicks(), { SubtitleStreamIndex: -1 });
}
}
else if (!currentStream && newStream) {
2015-03-30 12:57:37 -07:00
if (newStream.DeliveryMethod == 'External') {
2014-06-11 19:38:40 -07:00
selectedTrackElementIndex = index;
} else {
// Need to change the transcoded stream to add subs
self.changeStream(self.getCurrentTicks(), { SubtitleStreamIndex: index });
}
}
else if (currentStream && newStream) {
2015-03-30 12:57:37 -07:00
if (newStream.DeliveryMethod == 'External') {
selectedTrackElementIndex = index;
2014-06-14 19:58:00 -07:00
2015-03-30 12:57:37 -07:00
if (currentStream.DeliveryMethod != 'External') {
self.changeStream(self.getCurrentTicks(), { SubtitleStreamIndex: -1 });
}
} else {
// Need to change the transcoded stream to add subs
self.changeStream(self.getCurrentTicks(), { SubtitleStreamIndex: index });
}
}
2014-06-11 19:38:40 -07:00
self.setCurrentTrackElement(selectedTrackElementIndex);
2014-07-19 21:46:29 -07:00
2014-06-11 19:38:40 -07:00
self.currentSubtitleStreamIndex = index;
};
self.setCurrentTrackElement = function (index) {
var textStreams = self.currentMediaSource.MediaStreams.filter(function (s) {
2015-03-30 12:57:37 -07:00
return s.DeliveryMethod == 'External';
2014-06-11 19:38:40 -07:00
});
2014-07-19 21:46:29 -07:00
var newStream = textStreams.filter(function (s) {
return s.Index == index;
})[0];
var trackIndex = newStream ? textStreams.indexOf(newStream) : -1;
2015-06-13 07:46:59 -07:00
self.currentMediaRenderer.setCurrentTrackElement(trackIndex);
2014-05-07 22:04:39 -07:00
};
2014-06-14 19:58:00 -07:00
self.updateTextStreamUrls = function (startPositionTicks) {
2015-06-13 07:46:59 -07:00
self.currentMediaRenderer.updateTextStreamUrls(startPositionTicks);
2014-06-14 19:58:00 -07:00
};
2014-06-28 12:35:30 -07:00
self.updateNowPlayingInfo = function (item) {
if (!item) {
throw new Error('item cannot be null');
}
var mediaControls = $("#videoPlayer");
var state = self.getPlayerStateInternal(self.currentMediaRenderer, item.CurrentProgram || item, self.currentMediaSource);
2014-06-28 12:35:30 -07:00
var url = "";
2015-05-13 13:55:08 -07:00
var imageWidth = 400;
2015-05-13 22:42:55 -07:00
var imageHeight = 300;
2014-06-28 12:35:30 -07:00
if (state.NowPlayingItem.PrimaryImageTag) {
url = ApiClient.getScaledImageUrl(state.NowPlayingItem.PrimaryImageItemId, {
type: "Primary",
2015-05-13 10:53:26 -07:00
width: imageWidth,
2014-06-28 12:35:30 -07:00
tag: state.NowPlayingItem.PrimaryImageTag
});
}
else if (state.NowPlayingItem.PrimaryImageTag) {
url = ApiClient.getScaledImageUrl(state.NowPlayingItem.PrimaryImageItemId, {
type: "Primary",
2015-05-13 10:53:26 -07:00
width: imageWidth,
2014-06-28 12:35:30 -07:00
tag: state.NowPlayingItem.PrimaryImageTag
});
}
else if (state.NowPlayingItem.BackdropImageTag) {
url = ApiClient.getScaledImageUrl(state.NowPlayingItem.BackdropItemId, {
type: "Backdrop",
2015-05-13 10:53:26 -07:00
height: imageHeight,
2014-06-28 12:35:30 -07:00
tag: state.NowPlayingItem.BackdropImageTag,
index: 0
});
}
else if (state.NowPlayingItem.ThumbImageTag) {
url = ApiClient.getScaledImageUrl(state.NowPlayingItem.ThumbImageItemId, {
type: "Thumb",
2015-05-13 10:53:26 -07:00
height: imageHeight,
2014-06-28 12:35:30 -07:00
tag: state.NowPlayingItem.ThumbImageTag
});
}
if (url) {
$('.nowPlayingImage', mediaControls).html('<img src="' + url + '" />');
} else {
$('.nowPlayingImage', mediaControls).html('');
}
if (state.NowPlayingItem.LogoItemId) {
url = ApiClient.getScaledImageUrl(state.NowPlayingItem.LogoItemId, {
type: "Logo",
2014-06-28 19:30:20 -07:00
height: 42,
2014-06-28 12:35:30 -07:00
tag: state.NowPlayingItem.LogoImageTag
});
$('.videoTopControlsLogo', mediaControls).html('<img src="' + url + '" />');
} else {
$('.videoTopControlsLogo', mediaControls).html('');
}
var elem = $('.nowPlayingTabs', mediaControls).html(getNowPlayingTabsHtml(item.CurrentProgram || item)).lazyChildren();
2015-05-13 20:24:25 -07:00
$('.nowPlayingTabButton', elem).on('click', function () {
if (!$(this).hasClass('selectedNowPlayingTabButton')) {
$('.selectedNowPlayingTabButton').removeClass('selectedNowPlayingTabButton');
$(this).addClass('selectedNowPlayingTabButton');
$('.nowPlayingTab').hide();
2015-05-13 22:42:55 -07:00
$('.' + this.getAttribute('data-tab')).show().trigger('scroll');
2015-05-13 20:24:25 -07:00
}
});
$('.chapterCard', elem).on('click', function () {
self.seek(parseInt(this.getAttribute('data-position')));
});
};
2015-11-28 17:23:48 -07:00
$.fn.lazyChildren = function () {
for (var i = 0, length = this.length; i < length; i++) {
ImageLoader.lazyChildren(this[i]);
}
return this;
};
2015-05-13 20:24:25 -07:00
function getNowPlayingTabsHtml(item) {
var html = '';
html += '<div class="nowPlayingTabButtons">';
html += '<a href="#" class="nowPlayingTabButton selectedNowPlayingTabButton" data-tab="tabInfo">' + Globalize.translate('TabInfo') + '</a>';
if (item.Chapters && item.Chapters.length) {
html += '<a href="#" class="nowPlayingTabButton" data-tab="tabScenes">' + Globalize.translate('TabScenes') + '</a>';
}
if (item.People && item.People.length) {
html += '<a href="#" class="nowPlayingTabButton" data-tab="tabCast">' + Globalize.translate('TabCast') + '</a>';
}
html += '</div>';
html += '<div class="tabInfo nowPlayingTab">';
var nameHtml = MediaController.getNowPlayingNameHtml(item, false);
2015-05-13 10:53:26 -07:00
nameHtml = '<div class="videoNowPlayingName">' + nameHtml + '</div>';
var miscInfo = LibraryBrowser.getMiscInfoHtml(item);
if (miscInfo) {
nameHtml += '<div class="videoNowPlayingRating">' + miscInfo + '</div>';
}
var ratingHtml = LibraryBrowser.getRatingHtml(item);
if (ratingHtml) {
nameHtml += '<div class="videoNowPlayingRating">' + ratingHtml + '</div>';
}
if (item.Overview) {
nameHtml += '<div class="videoNowPlayingOverview">' + item.Overview + '</div>';
}
2015-05-13 20:24:25 -07:00
html += nameHtml;
html += '</div>';
if (item.Chapters && item.Chapters.length) {
2015-05-16 12:09:02 -07:00
html += '<div class="tabScenes nowPlayingTab hiddenScrollX" style="display:none;white-space:nowrap;margin-bottom:2em;">';
2015-05-13 20:24:25 -07:00
var chapterIndex = 0;
html += item.Chapters.map(function (c) {
2015-06-11 10:57:59 -07:00
var width = 240;
2015-05-13 20:24:25 -07:00
var chapterHtml = '<a class="card backdropCard chapterCard" href="#" style="margin-right:1em;width:' + width + 'px;" data-position="' + c.StartPositionTicks + '">';
chapterHtml += '<div class="cardBox">';
chapterHtml += '<div class="cardScalable">';
chapterHtml += '<div class="cardPadder"></div>';
chapterHtml += '<div class="cardContent">';
if (c.ImageTag) {
var chapterImageUrl = ApiClient.getScaledImageUrl(item.Id, {
width: width,
tag: c.ImageTag,
type: "Chapter",
index: chapterIndex
});
chapterHtml += '<div class="cardImage lazy" data-src="' + chapterImageUrl + '"></div>';
} else {
chapterHtml += '<div class="cardImage" style="background:#444;"></div>';
}
chapterHtml += '<div class="cardFooter">';
if (c.Name) {
chapterHtml += '<div class="cardText">' + c.Name + '</div>';
}
chapterHtml += '<div class="cardText">' + Dashboard.getDisplayTime(c.StartPositionTicks) + '</div>';
chapterHtml += '</div>';
chapterHtml += '</div>';
chapterHtml += '</div>';
chapterHtml += '</div>';
chapterHtml += '</a>';
chapterIndex++;
return chapterHtml;
}).join('');
html += '</div>';
}
if (item.People && item.People.length) {
2015-05-16 12:09:02 -07:00
html += '<div class="tabCast nowPlayingTab hiddenScrollX" style="display:none;white-space:nowrap;">';
2015-05-13 20:24:25 -07:00
html += item.People.map(function (cast) {
var personHtml = '<div class="tileItem smallPosterTileItem" style="width:300px;">';
var imgUrl;
2015-07-03 04:51:45 -07:00
var height = 150;
2015-05-13 20:24:25 -07:00
if (cast.PrimaryImageTag) {
imgUrl = ApiClient.getScaledImageUrl(cast.Id, {
2015-05-27 22:51:48 -07:00
height: height,
2015-05-13 20:24:25 -07:00
tag: cast.PrimaryImageTag,
type: "primary",
minScale: 2
});
2015-09-11 19:18:09 -07:00
personHtml += '<div class="tileImage lazy" data-src="' + imgUrl + '" style="height:' + height + 'px;"></div>';
2015-05-13 20:24:25 -07:00
} else {
imgUrl = "css/images/items/list/person.png";
2015-09-11 19:18:09 -07:00
personHtml += '<div class="tileImage" style="background-image:url(\'' + imgUrl + '\');height:' + height + 'px;"></div>';
2015-05-13 20:24:25 -07:00
}
personHtml += '<div class="tileContent">';
personHtml += '<p>' + cast.Name + '</p>';
var role = cast.Role ? Globalize.translate('ValueAsRole', cast.Role) : cast.Type;
if (role == "GuestStar") {
role = Globalize.translate('ValueGuestStar');
}
role = role || "";
var maxlength = 40;
if (role.length > maxlength) {
role = role.substring(0, maxlength - 3) + '...';
}
personHtml += '<p>' + role + '</p>';
personHtml += '</div>';
personHtml += '</div>';
return personHtml;
}).join('');
html += '</div>';
}
return html;
}
2014-06-28 12:35:30 -07:00
2015-09-09 10:49:44 -07:00
function getSeekableDuration() {
if (self.currentMediaSource && self.currentMediaSource.RunTimeTicks) {
return self.currentMediaSource.RunTimeTicks;
}
if (self.currentMediaRenderer) {
return self.getCurrentTicks(self.currentMediaRenderer);
}
return null;
}
function onPositionSliderChange() {
var newPercent = parseInt(this.value);
2015-09-09 10:49:44 -07:00
var newPositionTicks = (newPercent / 100) * getSeekableDuration();
self.changeStream(Math.floor(newPositionTicks));
}
2015-06-27 12:53:36 -07:00
self.onAudioOptionSelected = function (index) {
2015-05-21 13:53:14 -07:00
2015-06-27 12:53:36 -07:00
self.setAudioStreamIndex(index);
};
2015-05-22 13:15:29 -07:00
2015-06-27 12:53:36 -07:00
self.onSubtitleOptionSelected = function (index) {
self.setSubtitleStreamIndex(index);
2015-05-22 13:15:29 -07:00
};
2015-05-21 13:53:14 -07:00
2015-06-27 12:53:36 -07:00
self.onQualityOptionSelected = function (bitrate) {
2015-05-21 13:53:14 -07:00
2015-06-27 12:53:36 -07:00
AppSettings.maxStreamingBitrate(bitrate);
2015-05-21 13:53:14 -07:00
2015-06-27 12:53:36 -07:00
self.changeStream(self.getCurrentTicks(), {
Bitrate: bitrate
});
2015-05-22 13:15:29 -07:00
};
2015-08-28 12:10:44 -07:00
self.toggleInfo = function () {
var button = document.querySelector('.mediaButton.infoButton');
var nowPlayingInfo = document.querySelector('.videoControls .nowPlayingInfo');
if (button.classList.contains('active')) {
button.classList.remove('active');
document.querySelector('.videoControls').classList.add('hiddenOnIdle');
fadeOutDown(nowPlayingInfo);
} else {
button.classList.add('active');
document.querySelector('.videoControls').classList.remove('hiddenOnIdle');
nowPlayingInfo.classList.remove('hide');
fadeInUp(nowPlayingInfo);
}
};
2015-10-08 12:12:53 -07:00
self.toggleGuide = function () {
var button = document.querySelector('.mediaButton.guideButton');
var nowPlayingInfo = document.querySelector('.videoControls .guide');
if (button.classList.contains('active')) {
button.classList.remove('active');
document.querySelector('.videoControls').classList.add('hiddenOnIdle');
fadeOutDown(nowPlayingInfo);
} else {
button.classList.add('active');
document.querySelector('.videoControls').classList.remove('hiddenOnIdle');
nowPlayingInfo.classList.remove('hide');
fadeInUp(nowPlayingInfo);
if (!self.guideInstance) {
require(['tvguide'], function (tvguide) {
self.guideInstance = new tvguide({
element: nowPlayingInfo,
enablePaging: false
});
});
}
}
};
2015-08-28 12:10:44 -07:00
function fadeInUp(elem) {
var keyframes = [
{ transform: 'translate3d(0, 100%, 0)', offset: 0 },
{ transform: 'none', offset: 1 }];
var timing = { duration: 300, iterations: 1 };
elem.animate(keyframes, timing);
}
function fadeOutDown(elem) {
var keyframes = [{ transform: 'none', offset: 0 },
{ transform: 'translate3d(0, 100%, 0)', offset: 1 }];
var timing = { duration: 300, iterations: 1 };
elem.animate(keyframes, timing).onfinish = function () {
elem.classList.add('hide');
};
}
2015-06-27 12:53:36 -07:00
function ensureVideoPlayerElements() {
2015-05-22 13:15:29 -07:00
var html = '';
2015-05-22 13:15:29 -07:00
html += '<div id="videoPlayer" class="hide">';
2015-05-22 13:15:29 -07:00
2015-06-27 12:53:36 -07:00
html += '<div id="videoElement">';
html += '<div id="play" class="status"></div>';
html += '<div id="pause" class="status"></div>';
html += '</div>';
2015-05-22 13:15:29 -07:00
2015-06-27 12:53:36 -07:00
html += '<div class="videoTopControls hiddenOnIdle">';
html += '<div class="videoTopControlsLogo"></div>';
html += '<div class="videoAdvancedControls">';
2015-05-22 13:15:29 -07:00
2015-07-08 09:10:34 -07:00
html += '<paper-icon-button icon="skip-previous" class="previousTrackButton mediaButton videoTrackControl hide" onclick="MediaPlayer.previousTrack();"></paper-icon-button>';
html += '<paper-icon-button icon="skip-next" class="nextTrackButton mediaButton videoTrackControl hide" onclick="MediaPlayer.nextTrack();"></paper-icon-button>';
2015-05-21 13:53:14 -07:00
2015-06-27 12:53:36 -07:00
// Embedding onclicks due to issues not firing in cordova safari
html += '<paper-icon-button icon="audiotrack" class="mediaButton videoAudioButton" onclick="MediaPlayer.showAudioTracksFlyout();"></paper-icon-button>';
2015-09-08 07:35:52 -07:00
html += '<paper-icon-button icon="closed-caption" class="mediaButton videoSubtitleButton" onclick="MediaPlayer.showSubtitleMenu();"></paper-icon-button>';
2015-06-25 14:50:56 -07:00
2015-06-27 12:53:36 -07:00
html += '<paper-icon-button icon="settings" class="mediaButton videoQualityButton" onclick="MediaPlayer.showQualityFlyout();"></paper-icon-button>';
2015-06-27 12:53:36 -07:00
html += '<paper-icon-button icon="close" class="mediaButton" onclick="MediaPlayer.stop();"></paper-icon-button>';
2015-06-27 12:53:36 -07:00
html += '</div>'; // videoAdvancedControls
html += '</div>'; // videoTopControls
2015-06-27 12:53:36 -07:00
// Create controls
html += '<div class="videoControls hiddenOnIdle">';
2015-08-28 12:10:44 -07:00
html += '<div class="nowPlayingInfo hide">';
2015-06-27 12:53:36 -07:00
html += '<div class="nowPlayingImage"></div>';
html += '<div class="nowPlayingTabs"></div>';
html += '</div>'; // nowPlayingInfo
2015-10-08 12:12:53 -07:00
html += '<div class="guide hide">';
html += '</div>'; // guide
2015-08-28 12:10:44 -07:00
html += '<div class="videoControlButtons">';
2015-07-08 09:10:34 -07:00
html += '<paper-icon-button icon="skip-previous" class="previousTrackButton mediaButton videoTrackControl hide" onclick="MediaPlayer.previousTrack();"></paper-icon-button>';
2015-06-27 12:53:36 -07:00
html += '<paper-icon-button id="video-playButton" icon="play-arrow" class="mediaButton unpauseButton" onclick="MediaPlayer.unpause();"></paper-icon-button>';
html += '<paper-icon-button id="video-pauseButton" icon="pause" class="mediaButton pauseButton" onclick="MediaPlayer.pause();"></paper-icon-button>';
2015-07-08 09:10:34 -07:00
html += '<paper-icon-button icon="skip-next" class="nextTrackButton mediaButton videoTrackControl hide" onclick="MediaPlayer.nextTrack();"></paper-icon-button>';
2015-11-17 22:49:20 -07:00
html += '<paper-slider pin step=".1" min="0" max="100" value="0" class="videoPositionSlider" style="display:inline-block;margin-right:2em;"></paper-slider>';
2015-06-27 12:53:36 -07:00
html += '<div class="currentTime">--:--</div>';
2015-06-27 12:53:36 -07:00
html += '<paper-icon-button icon="volume-up" class="muteButton mediaButton" onclick="MediaPlayer.mute();"></paper-icon-button>';
html += '<paper-icon-button icon="volume-off" class="unmuteButton mediaButton" onclick="MediaPlayer.unMute();"></paper-icon-button>';
2015-11-17 22:49:20 -07:00
html += '<paper-slider pin step="1" min="0" max="100" value="0" class="videoVolumeSlider" style="width:100px;vertical-align:middle;margin-left:-1em;margin-right:2em;display:inline-block;"></paper-slider>';
2015-06-27 12:53:36 -07:00
html += '<paper-icon-button icon="fullscreen" class="mediaButton fullscreenButton" onclick="MediaPlayer.toggleFullscreen();" id="video-fullscreenButton"></paper-icon-button>';
2015-08-28 12:10:44 -07:00
html += '<paper-icon-button icon="info" class="mediaButton infoButton" onclick="MediaPlayer.toggleInfo();"></paper-icon-button>';
2015-10-08 12:12:53 -07:00
//html += '<paper-icon-button icon="dvr" class="mediaButton guideButton" onclick="MediaPlayer.toggleGuide();"></paper-icon-button>';
2015-08-28 12:10:44 -07:00
html += '</div>';
2015-06-27 12:53:36 -07:00
html += '</div>'; // videoControls
2015-06-27 12:53:36 -07:00
html += '</div>'; // videoPlayer
2015-06-29 11:45:42 -07:00
var div = document.createElement('div');
div.innerHTML = html;
document.body.appendChild(div);
2015-06-27 12:53:36 -07:00
}
2015-11-27 17:04:04 -07:00
var initComplete;
function initVideoElements() {
if (initComplete) {
return;
}
2015-06-27 12:53:36 -07:00
2015-11-27 17:04:04 -07:00
initComplete = true;
2015-06-27 12:53:36 -07:00
ensureVideoPlayerElements();
var parent = $("#videoPlayer");
2015-06-27 12:53:36 -07:00
muteButton = $('.muteButton', parent);
unmuteButton = $('.unmuteButton', parent);
currentTimeElement = $('.currentTime', parent);
positionSlider = $(".videoPositionSlider", parent).on('change', onPositionSliderChange)[0];
positionSlider._setPinValue = function (value) {
2015-09-09 10:49:44 -07:00
var seekableDuration = getSeekableDuration();
if (!self.currentMediaSource || !seekableDuration) {
2015-06-27 12:53:36 -07:00
this.pinValue = '--:--';
return;
}
2015-09-09 10:49:44 -07:00
var ticks = seekableDuration;
2015-06-27 12:53:36 -07:00
ticks /= 100;
ticks *= value;
this.pinValue = Dashboard.getDisplayTime(ticks);
};
volumeSlider = $('.videoVolumeSlider', parent).on('change', function () {
var vol = this.value;
updateVolumeButtons(vol);
self.setVolume(vol);
})[0];
2015-11-27 17:04:04 -07:00
}
2015-05-25 10:32:22 -07:00
var idleHandlerTimeout;
function idleHandler() {
2014-06-21 22:52:31 -07:00
2015-05-25 10:32:22 -07:00
if (idleHandlerTimeout) {
window.clearTimeout(idleHandlerTimeout);
}
if (idleState == true) {
2014-06-28 12:35:30 -07:00
$('.hiddenOnIdle').removeClass("inactive");
2014-10-09 15:22:04 -07:00
$('#videoPlayer').removeClass('idlePlayer');
}
idleState = false;
2015-05-25 10:32:22 -07:00
idleHandlerTimeout = window.setTimeout(function () {
idleState = true;
2014-06-28 12:35:30 -07:00
$('.hiddenOnIdle').addClass("inactive");
2014-10-09 15:22:04 -07:00
$('#videoPlayer').addClass('idlePlayer');
2015-06-26 08:53:49 -07:00
}, 3500);
}
function updateVolumeButtons(vol) {
if (vol) {
muteButton.show();
unmuteButton.hide();
} else {
muteButton.hide();
unmuteButton.show();
}
}
function requestFullScreen(element) {
// Supports most browsers and their versions.
2015-05-17 18:27:48 -07:00
var requestMethod = element.requestFullscreen || element.webkitRequestFullscreen || element.mozRequestFullScreen || element.msRequestFullscreen;
if (requestMethod) { // Native full screen.
requestMethod.call(element);
} else {
enterFullScreen();
}
}
function enterFullScreen() {
2014-03-17 07:48:16 -07:00
var player = $("#videoPlayer");
2014-05-29 12:34:20 -07:00
player.addClass("fullscreenVideo");
}
function exitFullScreenToWindow() {
2014-03-17 07:48:16 -07:00
var player = $("#videoPlayer");
2014-05-29 12:34:20 -07:00
player.removeClass("fullscreenVideo");
}
2015-06-29 11:45:42 -07:00
function onPopState() {
// Stop playback on browser back button nav
self.stop();
return;
}
2014-06-21 22:52:31 -07:00
2015-06-29 11:45:42 -07:00
function onFullScreenChange() {
if (self.isFullScreen()) {
enterFullScreen();
idleState = true;
} else {
exitFullScreenToWindow();
}
2015-06-29 11:45:42 -07:00
}
2015-10-23 09:04:33 -07:00
var lastMousePosition = {};
function onMouseMove(evt) {
if (evt.clientX == lastMousePosition.x && evt.clientY == lastMousePosition.y) {
return;
}
lastMousePosition.x = evt.clientX;
lastMousePosition.y = evt.clientY;
idleHandler();
}
2015-06-29 11:45:42 -07:00
function bindEventsForPlayback(mediaRenderer) {
2014-06-21 22:52:31 -07:00
2015-12-17 09:21:21 -07:00
Events.on(mediaRenderer, 'playing', onOnePlaying);
Events.on(mediaRenderer, 'playing', onPlaying);
Events.on(mediaRenderer, 'volumechange', onVolumeChange);
Events.on(mediaRenderer, 'pause', onPause);
Events.on(mediaRenderer, 'timeupdate', onTimeUpdate);
Events.on(mediaRenderer, 'error', onError);
Events.on(mediaRenderer, 'click', onClick);
Events.on(mediaRenderer, 'dblclick', onDoubleClick);
2015-06-29 11:45:42 -07:00
var hideElementsOnIdle = true;
2014-06-21 22:52:31 -07:00
2015-06-29 11:45:42 -07:00
if (hideElementsOnIdle) {
var itemVideo = document.querySelector('.itemVideo');
if (itemVideo) {
2015-10-23 09:04:33 -07:00
//Events.on(itemVideo, 'mousemove', onMouseMove);
2015-11-27 10:46:58 -07:00
itemVideo.addEventListener('keydown', idleHandler);
itemVideo.addEventListener('scroll', idleHandler);
itemVideo.addEventListener('mousedown', idleHandler);
2015-06-29 11:45:42 -07:00
idleHandler();
2014-06-21 22:52:31 -07:00
}
2015-06-29 11:45:42 -07:00
}
2014-06-21 22:52:31 -07:00
2015-06-29 11:45:42 -07:00
$(document).on('webkitfullscreenchange', onFullScreenChange);
$(document).on('mozfullscreenchange', onFullScreenChange);
$(document).on('msfullscreenchange', onFullScreenChange);
$(document).on('fullscreenchange', onFullScreenChange);
2014-06-21 22:52:31 -07:00
2015-06-29 11:45:42 -07:00
$(window).one("popstate", onPopState);
2014-06-21 22:52:31 -07:00
2015-06-29 11:45:42 -07:00
if (hideElementsOnIdle) {
2015-10-23 09:04:33 -07:00
$(document.body).on("mousemove", onMouseMove);
}
2014-06-21 22:52:31 -07:00
}
2015-06-29 11:45:42 -07:00
function unbindEventsForPlayback(mediaRenderer) {
2014-06-21 22:52:31 -07:00
2015-12-17 09:21:21 -07:00
Events.off(mediaRenderer, 'playing', onOnePlaying);
Events.off(mediaRenderer, 'playing', onPlaying);
Events.off(mediaRenderer, 'volumechange', onVolumeChange);
Events.off(mediaRenderer, 'pause', onPause);
Events.off(mediaRenderer, 'timeupdate', onTimeUpdate);
Events.off(mediaRenderer, 'error', onError);
Events.off(mediaRenderer, 'click', onClick);
Events.off(mediaRenderer, 'dblclick', onDoubleClick);
2015-06-29 11:45:42 -07:00
$(document).off('webkitfullscreenchange', onFullScreenChange);
$(document).off('mozfullscreenchange', onFullScreenChange);
$(document).off('msfullscreenchange', onFullScreenChange);
$(document).off('fullscreenchange', onFullScreenChange);
2014-06-21 22:52:31 -07:00
// Stop playback on browser back button nav
2015-06-29 11:45:42 -07:00
$(window).off("popstate", onPopState);
2014-06-21 22:52:31 -07:00
2015-10-23 09:04:33 -07:00
$(document.body).off("mousemove", onMouseMove);
2014-06-21 22:52:31 -07:00
2015-06-29 11:45:42 -07:00
var itemVideo = document.querySelector('.itemVideo');
if (itemVideo) {
2015-10-23 09:04:33 -07:00
//Events.off(itemVideo, 'mousemove', onMouseMove);
2015-11-27 10:46:58 -07:00
itemVideo.removeEventListener('keydown', idleHandler);
itemVideo.removeEventListener('scroll', idleHandler);
itemVideo.removeEventListener('mousedown', idleHandler);
2015-06-29 11:45:42 -07:00
}
2014-06-21 22:52:31 -07:00
}
2014-08-10 15:13:17 -07:00
// Replace audio version
2015-06-07 13:06:18 -07:00
self.cleanup = function (mediaRenderer) {
2014-08-10 15:13:17 -07:00
2015-11-27 17:04:04 -07:00
if (currentTimeElement) {
currentTimeElement.html('--:--');
}
2014-08-10 15:13:17 -07:00
2015-06-29 11:45:42 -07:00
unbindEventsForPlayback(mediaRenderer);
2014-08-10 15:13:17 -07:00
};
2015-07-08 09:10:34 -07:00
self.playVideo = function (item, mediaSource, startPosition, callback) {
// TODO: remove dependency on nowplayingbar
2015-12-04 12:58:30 -07:00
requirejs(['videorenderer', 'css!css/nowplayingbar.css', 'css!css/mediaplayer-video.css', 'paper-slider'], function () {
2015-11-27 17:04:04 -07:00
initVideoElements();
2015-11-28 01:07:44 -07:00
self.createStreamInfo('Video', item, mediaSource, startPosition).then(function (streamInfo) {
2015-04-28 06:56:57 -07:00
2015-09-21 08:43:10 -07:00
// Huge hack alert. Safari doesn't seem to like if the segments aren't available right away when playback starts
// This will start the transcoding process before actually feeding the video url into the player
2015-11-28 13:48:35 -07:00
if (browserInfo.safari && !mediaSource.RunTimeTicks) {
2015-04-28 06:56:57 -07:00
2015-09-21 08:43:10 -07:00
Dashboard.showLoadingMsg();
2015-12-30 11:02:44 -07:00
var hlsPlaylistUrl = streamInfo.url.replace('master.m3u8', 'live.m3u8');
2015-09-21 08:43:10 -07:00
ApiClient.ajax({
2015-11-28 01:07:44 -07:00
2015-09-21 08:43:10 -07:00
type: 'GET',
2015-12-30 11:02:44 -07:00
url: hlsPlaylistUrl
2015-08-24 13:37:34 -07:00
2015-11-28 01:07:44 -07:00
}).then(function () {
2015-09-21 08:43:10 -07:00
Dashboard.hideLoadingMsg();
2015-12-30 11:02:44 -07:00
streamInfo.url = hlsPlaylistUrl;
2015-09-21 08:43:10 -07:00
self.playVideoInternal(item, mediaSource, startPosition, streamInfo, callback);
2015-11-28 01:07:44 -07:00
}, function () {
Dashboard.hideLoadingMsg();
2015-09-21 08:43:10 -07:00
});
2015-04-28 06:56:57 -07:00
2015-09-21 08:43:10 -07:00
} else {
self.playVideoInternal(item, mediaSource, startPosition, streamInfo, callback);
}
});
2015-06-07 20:16:42 -07:00
});
2015-04-28 06:56:57 -07:00
};
function fadeOut(elem) {
if (elem.classList.contains('hide')) {
return;
}
var onfinish = function () {
elem.classList.add('hide');
};
2015-12-30 11:02:44 -07:00
//if (!browserInfo.animate) {
2015-12-30 13:25:17 -07:00
onfinish();
return;
2015-12-30 11:02:44 -07:00
//}
requestAnimationFrame(function () {
var keyframes = [
{ opacity: '1', offset: 0 },
{ opacity: '0', offset: 1 }];
2015-12-02 20:20:52 -07:00
var timing = { duration: 600, iterations: 1, easing: 'ease-out' };
elem.animate(keyframes, timing).onfinish = onfinish;
});
}
function fadeIn(elem) {
if (!elem.classList.contains('hide')) {
return;
}
elem.classList.remove('hide');
2015-12-30 13:25:17 -07:00
if (!browserInfo.animate || browserInfo.mobile) {
return;
}
requestAnimationFrame(function () {
var keyframes = [
{ transform: 'scale3d(.2, .2, .2) ', opacity: '.6', offset: 0 },
{ transform: 'none', opacity: '1', offset: 1 }
];
2015-11-30 10:21:52 -07:00
var timing = { duration: 200, iterations: 1, easing: 'ease-out' };
elem.animate(keyframes, timing);
});
}
2015-07-08 09:10:34 -07:00
self.playVideoInternal = function (item, mediaSource, startPosition, streamInfo, callback) {
2015-04-28 06:56:57 -07:00
self.startTimeTicksOffset = streamInfo.startTimeTicksOffset;
var mediaStreams = mediaSource.MediaStreams || [];
2014-06-11 12:31:33 -07:00
var subtitleStreams = mediaStreams.filter(function (s) {
return s.Type == 'Subtitle';
});
// Create video player
var mediaPlayerContainer = document.querySelector('#videoPlayer');
fadeIn(mediaPlayerContainer);
2014-06-28 12:35:30 -07:00
var videoControls = $('.videoControls', mediaPlayerContainer);
//show stop button
$('#video-playButton', videoControls).hide();
$('#video-pauseButton', videoControls).show();
2015-11-28 13:39:14 -07:00
$('.videoTrackControl').addClass('hide');
2014-06-21 22:52:31 -07:00
2015-07-03 04:51:45 -07:00
var videoElement = $('#videoElement', mediaPlayerContainer);
2014-06-28 12:35:30 -07:00
$('.videoQualityButton', videoControls).show();
2014-06-11 12:31:33 -07:00
if (mediaStreams.filter(function (s) {
return s.Type == "Audio";
}).length) {
2014-06-28 12:35:30 -07:00
$('.videoAudioButton').show();
} else {
2014-06-28 12:35:30 -07:00
$('.videoAudioButton').hide();
}
2014-06-11 12:31:33 -07:00
if (subtitleStreams.length) {
2014-06-28 12:35:30 -07:00
$('.videoSubtitleButton').show();
} else {
2014-06-28 12:35:30 -07:00
$('.videoSubtitleButton').hide();
}
2015-07-03 09:49:49 -07:00
var mediaRenderer = new VideoRenderer({
2015-09-09 20:22:52 -07:00
2015-07-03 09:49:49 -07:00
poster: self.getPosterUrl(item)
});
2015-07-03 04:51:45 -07:00
var requiresNativeControls = !mediaRenderer.enableCustomVideoControls();
2015-09-08 07:35:52 -07:00
if (requiresNativeControls || AppInfo.isNativeApp) {
$('#video-fullscreenButton', videoControls).hide();
} else {
2015-10-05 09:05:08 -07:00
$('#video-fullscreenButton', videoControls).show();
}
2015-05-21 13:53:14 -07:00
if (AppInfo.hasPhysicalVolumeButtons) {
2015-11-28 13:39:14 -07:00
$(volumeSlider).addClass('hide');
2014-06-28 12:35:30 -07:00
$('.muteButton', videoControls).addClass('hide');
$('.unmuteButton', videoControls).addClass('hide');
} else {
2015-11-28 13:39:14 -07:00
$(volumeSlider).removeClass('hide');
2014-06-28 12:35:30 -07:00
$('.muteButton', videoControls).removeClass('hide');
$('.unmuteButton', videoControls).removeClass('hide');
}
if (requiresNativeControls) {
videoControls.addClass('hide');
} else {
videoControls.removeClass('hide');
}
initialVolume = self.getSavedVolume();
2015-06-07 13:06:18 -07:00
mediaRenderer.volume(initialVolume);
2015-06-27 12:53:36 -07:00
volumeSlider.value = initialVolume * 100;
updateVolumeButtons(initialVolume);
2015-12-17 09:21:21 -07:00
bindEventsForPlayback(mediaRenderer);
2015-12-17 09:21:21 -07:00
self.currentSubtitleStreamIndex = mediaSource.DefaultSubtitleStreamIndex;
2015-12-17 09:21:21 -07:00
$(document.body).addClass('bodyWithPopupOpen');
2014-08-10 15:13:17 -07:00
2015-12-17 09:21:21 -07:00
self.currentMediaRenderer = mediaRenderer;
self.currentDurationTicks = self.currentMediaSource.RunTimeTicks;
2015-12-17 09:21:21 -07:00
self.updateNowPlayingInfo(item);
2015-12-17 09:21:21 -07:00
mediaRenderer.init().then(function () {
2015-12-17 09:21:21 -07:00
self.onBeforePlaybackStart(mediaRenderer, item, mediaSource);
2015-12-17 09:21:21 -07:00
self.setSrcIntoRenderer(mediaRenderer, streamInfo, item, self.currentMediaSource);
self.streamInfo = streamInfo;
2015-12-17 09:21:21 -07:00
if (callback) {
callback();
}
});
};
2015-12-17 09:21:21 -07:00
function onOnePlaying() {
2015-12-17 09:21:21 -07:00
Events.off(this, 'playing', onOnePlaying);
2015-12-17 09:21:21 -07:00
// For some reason this is firing at the start, so don't bind until playback has begun
Events.on(this, 'ended', self.onPlaybackStopped);
Events.on(this, 'ended', self.playNextAfterEnded);
2015-12-17 09:21:21 -07:00
self.onPlaybackStart(this, self.currentItem, self.currentMediaSource);
}
2015-12-17 09:21:21 -07:00
function onPlaying() {
2014-07-21 18:29:06 -07:00
2015-12-17 09:21:21 -07:00
var videoControls = document.querySelector('#videoPlayer .videoControls');
var videoElement = document.querySelector('#videoPlayer #videoElement');
2015-12-17 09:21:21 -07:00
$('#video-playButton', videoControls).hide();
$('#video-pauseButton', videoControls).show();
$("#play", videoElement).show().addClass("fadeOut");
setTimeout(function () {
$("#play", videoElement).hide().removeClass("fadeOut");
}, 300);
}
2015-08-27 08:58:07 -07:00
2015-12-17 09:21:21 -07:00
function onVolumeChange() {
2015-12-17 09:21:21 -07:00
updateVolumeButtons(this.volume());
}
2015-12-17 09:21:21 -07:00
function onPause() {
2015-12-17 09:21:21 -07:00
var videoControls = document.querySelector('#videoPlayer .videoControls');
var videoElement = document.querySelector('#videoPlayer #videoElement');
2015-12-17 09:21:21 -07:00
$('#video-playButton', videoControls).show();
$('#video-pauseButton', videoControls).hide();
$("#pause", videoElement).show().addClass("fadeOut");
setTimeout(function () {
$("#pause", videoElement).hide().removeClass("fadeOut");
}, 300);
}
2015-12-17 09:21:21 -07:00
function onTimeUpdate() {
if (!positionSlider.dragging) {
2015-12-17 09:21:21 -07:00
self.setCurrentTime(self.getCurrentTicks(this), positionSlider, currentTimeElement);
}
}
2014-06-28 12:35:30 -07:00
2015-12-17 09:21:21 -07:00
function onError() {
var errorMsg = Globalize.translate('MessageErrorPlayingVideo');
2015-04-28 06:56:57 -07:00
2015-12-17 09:21:21 -07:00
if (item.Type == "TvChannel") {
errorMsg += '<p>';
errorMsg += Globalize.translate('MessageEnsureOpenTuner');
errorMsg += '</p>';
}
2015-07-03 04:51:45 -07:00
2015-12-17 09:21:21 -07:00
Dashboard.alert({
title: Globalize.translate('HeaderVideoError'),
message: errorMsg
});
2015-07-03 09:49:49 -07:00
2015-12-17 09:21:21 -07:00
self.onPlaybackStopped.call(mediaRenderer);
self.nextTrack();
}
2015-09-25 19:31:13 -07:00
2015-12-17 09:21:21 -07:00
function onClick() {
2015-07-03 04:51:45 -07:00
2015-12-17 09:21:21 -07:00
if (!browserInfo.mobile) {
if (this.paused()) {
self.unpause();
} else {
self.pause();
2015-07-08 09:10:34 -07:00
}
2015-12-17 09:21:21 -07:00
}
}
function onDoubleClick() {
if (!browserInfo.mobile) {
self.toggleFullscreen();
}
}
self.updatePlaylistUi = function () {
2015-11-27 17:04:04 -07:00
if (!initComplete) {
return;
}
2015-05-27 22:51:48 -07:00
var index = self.currentPlaylistIndex(null);
var length = self.playlist.length;
2015-07-03 04:51:45 -07:00
var requiresNativeControls = false;
2015-09-10 11:28:22 -07:00
if (self.currentMediaRenderer && self.currentMediaRenderer.enableCustomVideoControls) {
2015-07-03 04:51:45 -07:00
requiresNativeControls = self.currentMediaRenderer.enableCustomVideoControls();
}
2015-03-23 10:19:21 -07:00
if (length < 2) {
2015-11-28 13:39:14 -07:00
$('.videoTrackControl').addClass('hide');
return;
}
2015-06-28 07:45:21 -07:00
var controls = requiresNativeControls ? '.videoAdvancedControls' : '.videoControls';
2015-06-29 11:45:42 -07:00
controls = document.querySelector(controls);
2015-06-28 07:45:21 -07:00
var previousTrackButton = controls.getElementsByClassName('previousTrackButton')[0];
var nextTrackButton = controls.getElementsByClassName('nextTrackButton')[0];
if (index === 0) {
2015-06-28 07:45:21 -07:00
previousTrackButton.setAttribute('disabled', 'disabled');
} else {
2015-06-28 07:45:21 -07:00
previousTrackButton.removeAttribute('disabled');
}
if ((index + 1) >= length) {
2015-06-28 07:45:21 -07:00
nextTrackButton.setAttribute('disabled', 'disabled');
} else {
2015-06-28 07:45:21 -07:00
nextTrackButton.removeAttribute('disabled');
}
2015-11-28 13:39:14 -07:00
$(previousTrackButton).removeClass('hide');
$(nextTrackButton).removeClass('hide');
};
2014-06-21 22:52:31 -07:00
}
createVideoPlayer(MediaPlayer);
})();