create separate media encoding project

This commit is contained in:
Luke Pulverenti 2014-03-27 15:30:21 -04:00 committed by Tim Hobbs
parent c7582e0f7a
commit 10b3b030d8
5 changed files with 67 additions and 10 deletions

View File

@ -23,6 +23,31 @@
</li>
</ul>
<div data-role="controlgroup" data-type="horizontal" data-mini="true">
<input type="radio" name="radioProfileTab" class="radioProfileTab" id="radioInfo" value="tabInfo">
<label for="radioInfo">Info</label>
<input type="radio" name="radioProfileTab" class="radioProfileTab" id="radioIdentification" value="tabIdentification">
<label for="radioIdentification">Identification</label>
</div>
<br />
<div class="profileTab tabInfo">
<fieldset data-role="controlgroup">
<legend>Supported Media Types:</legend>
<input type="checkbox" data-mini="true" id="chkAudio" data-value="Audio" class="chkMediaType" />
<label for="chkAudio">Audio</label>
<input type="checkbox" data-mini="true" id="chkPhoto" data-value="Photo" class="chkMediaType" />
<label for="chkPhoto">Photo</label>
<input type="checkbox" data-mini="true" id="chkVideo" data-value="Video" class="chkMediaType" />
<label for="chkVideo">Video</label>
</fieldset>
</div>
<div class="profileTab tabIdentification">
</div>
<br />
<ul data-role="listview" class="ulForm">
<li>
<button class="btnSave" style="display: none;" type="submit" data-theme="b" data-icon="check" data-mini="true">

View File

@ -31,6 +31,10 @@
$('#txtName', page).val(profile.Name);
$('.chkMediaType', page).each(function () {
this.checked = (profile.SupportedMediaTypes || '').split(',').indexOf(this.getAttribute('data-value')) != -1;
}).checkboxradio('refresh');
}
function saveProfile(page, profile) {
@ -78,12 +82,30 @@
}
$(document).on('pageshow', "#dlnaProfilePage", function () {
$(document).on('pageinit', "#dlnaProfilePage", function () {
var page = this;
$('.radioProfileTab', page).on('change', function () {
$('.profileTab', page).hide();
$('.' + this.value, page).show();
});
}).on('pageshow', "#dlnaProfilePage", function () {
var page = this;
loadProfile(page);
}).on('pagebeforeshow', "#dlnaProfilePage", function () {
var page = this;
$('.radioSeriesTimerTab', page).checked(false).checkboxradio('refresh');
$('#radioInfo', page).checked(true).checkboxradio('refresh').trigger('change');
});
window.DlnaProfilePage = {

View File

@ -267,7 +267,7 @@
var page = this;
$('.radioSeriesTimerTab', page).checked(false).checkboxradio('refresh');
$('.radioProfileTab', page).checked(false).checkboxradio('refresh');
$('#radioSettings', page).checked(true).checkboxradio('refresh').trigger('change');
reload(page);

View File

@ -751,8 +751,6 @@
var seekParam = isStatic && startPosition ? '#t=' + (startPosition / 10000000) : '';
var mp4VideoUrl = ApiClient.getUrl('Videos/' + item.Id + '/stream.mp4', $.extend({}, baseParams, {
profile: 'baseline',
level: 3,
Static: isStatic,
maxWidth: mp4Quality.maxWidth,
videoBitrate: mp4Quality.videoBitrate,
@ -773,8 +771,6 @@
})) + seekParam;
var hlsVideoUrl = ApiClient.getUrl('Videos/' + item.Id + '/stream.m3u8', $.extend({}, baseParams, {
profile: 'baseline',
level: 3,
timeStampOffsetMs: 0,
maxWidth: m3U8Quality.maxWidth,
videoBitrate: m3U8Quality.videoBitrate,

View File

@ -118,7 +118,6 @@
params = params || {};
var currentSrc = element.currentSrc;
currentSrc = replaceQueryString(currentSrc, 'starttimeticks', ticks);
if (params.AudioStreamIndex != null) {
currentSrc = replaceQueryString(currentSrc, 'AudioStreamIndex', params.AudioStreamIndex);
@ -142,10 +141,18 @@
currentSrc = replaceQueryString(currentSrc, 'AudioBitrate', finalParams.audioBitrate);
currentSrc = replaceQueryString(currentSrc, 'Static', finalParams.isStatic);
currentSrc = replaceQueryString(currentSrc, 'AudioCodec', finalParams.audioCodec);
currentSrc = replaceQueryString(currentSrc, 'VideoCodec', finalParams.videoCodec);
currentSrc = replaceQueryString(currentSrc, 'profile', finalParams.profile || '');
currentSrc = replaceQueryString(currentSrc, 'level', finalParams.level || '');
if (finalParams.isStatic) {
currentSrc = currentSrc.replace('.webm', '.mp4').replace('.m3u8', '.mp4');
currentSrc = replaceQueryString(currentSrc, 'starttimeticks', '');
} else {
currentSrc = currentSrc.replace('.mp4', transcodingExtension);
currentSrc = currentSrc.replace('.mp4', transcodingExtension).replace('.m4v', transcodingExtension);
currentSrc = replaceQueryString(currentSrc, 'starttimeticks', ticks);
}
clearProgressInterval();
@ -260,7 +267,7 @@
var videoBitrate = bitrate - audioBitrate;
return {
var params = {
isStatic: canPlayDirect,
maxWidth: maxWidth,
audioCodec: transcodingExtension == '.webm' ? 'vorbis' : 'aac',
@ -268,6 +275,13 @@
audioBitrate: audioBitrate,
videoBitrate: videoBitrate
};
if (params.videoCodec == 'h264') {
params.profile = 'baseline';
params.level = '3';
}
return params;
};
self.canPlay = function (item, user) {