Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
WebTV: Code cosmetics
  • Loading branch information
ProfYaffle authored and perexg committed Oct 20, 2014
1 parent 008770c commit 60f6c90
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions src/webui/static/tv.js
Expand Up @@ -140,7 +140,7 @@ tv.ui.VideoPlayer = Ext.extend(Ext.Panel, (function() {
this.video.dom.addEventListener('loadeddata', function() {
setTimeout(function() {
self.play();
},
},
self.bufferLength);
});
}
Expand All @@ -157,31 +157,31 @@ tv.ui.VideoPlayer = Ext.extend(Ext.Panel, (function() {
url += 'playlist/channel/'
else
url += 'stream/channel/'

url += uuid;

if (params.profile)
url += "?profile=" + params.profile;

return url;
},

_getProfile: function() {
var el = this.video.dom;

// chrome can handle h264+aac within mkv, given that h264 codecs are available
if(Ext.isChrome &&
if(Ext.isChrome &&
el.canPlayType('video/mp4; codecs="avc1.42E01E, mp4a.40.2"') == 'probably')
return profiles['mkv'];

for (var key in profiles)
if(el.canPlayType(profiles[key].mimetype) == 'probably')
return profiles[key];

for (var key in profiles)
if(el.canPlayType(profiles[key].mimetype) == 'maybe')
return profiles[key];

return {};
},

Expand Down Expand Up @@ -209,13 +209,13 @@ tv.ui.VideoPlayer = Ext.extend(Ext.Panel, (function() {
this.message.update('A network error caused the video ' +
'download to fail part-way.');
break;

case err.MEDIA_ERR_DECODE:
this.message.update('The video playback was aborted due to ' +
'a corruption problem or because the video ' +
'used features your browser did not support.');
break;

case err.MEDIA_ERR_SRC_NOT_SUPPORTED:
this.message.update('The video could not be loaded, either because ' +
'the server or network failed or because the ' +
Expand Down Expand Up @@ -457,7 +457,7 @@ tv.app = function() {
params: { },
renderTo: Ext.getBody()
});

videoPlayer.setDisplaySize('100%', '00%');

var chList = new tv.ui.ChannelList({
Expand Down Expand Up @@ -563,15 +563,15 @@ tv.app = function() {
chList.on('pageup', function() {
pageBar.movePrevious();
});

chList.on('pagedown', function() {
pageBar.moveNext();
});

chList.on('pagefirst', function() {
pageBar.moveFirst();
});

chList.on('pagelast', function() {
pageBar.moveLast();
});
Expand All @@ -580,10 +580,10 @@ tv.app = function() {
switch(e.getKey()) {
case VK_ENTER:
chListPanel.show();
chList.focus();
chList.focus();
}
});

chListPanel.show();
chList.focus();
}
Expand Down

0 comments on commit 60f6c90

Please sign in to comment.