Skip to content

Commit

Permalink
small fixes / update web tv
Browse files Browse the repository at this point in the history
  • Loading branch information
jbleyel committed Nov 18, 2016
1 parent 3b51d93 commit 4a35678
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 5 deletions.
1 change: 1 addition & 0 deletions plugin/controllers/ipkg.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ def NoMoredata(self, data):
nresult = nresult.replace("\n "," ")
if self.format == "json":
data = []
nresult=unicode(nresult, errors='ignore')
data.append({"result": True,"packages": nresult.split("\n")})
self.request.setHeader("content-type", "text/plain")
self.request.write(json.dumps(data))
Expand Down
69 changes: 64 additions & 5 deletions plugin/controllers/views/ajax/webtv.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,19 @@
<div id="info">
<div style="display: inline-block; width: 100%; zoom: 1;background-image:none;" class="ui-widget-content">
<h3 class="ui-widget-header">Player</h3>
<div id="errPlayer" style="margin:0 auto 0 auto;width:640px;height:400px;">
<div>
The currect selected player and source will not work.

VLC Player will not work in Chrome.
VXG Player will only work in Chrome.

Openwebif via HTTP and Live Stream will not work.

....

</div>
</div>
<div id="vlcPlayer" style="margin:0 auto 0 auto;width:640px;height:400px;">
<embed type="application/x-vlc-plugin" pluginspage="http://www.videolan.org" version="VideoLAN.VLCPlugin.2" width="640px" height="360px" id="vlc"></embed>
</div>
Expand Down Expand Up @@ -139,11 +152,13 @@ var isChrome = !!window.chrome && !!window.chrome.webstore;
\$('#streamchannels_chosen').css('display','inline-block');
\$('#streamrecordings_chosen').css('display','none');
\$('#moviesort-button').hide();
self.CheckPlayer();
});
\$('#sbtn1').click(function(){
\$('#streamrecordings_chosen').css('display','inline-block');
\$('#streamchannels_chosen').css('display','none');
\$('#moviesort-button').show();
self.CheckPlayer();
});

\$("#srcbuttons").buttonset();
Expand All @@ -167,6 +182,7 @@ var isChrome = !!window.chrome && !!window.chrome.webstore;
{
\$("#streamrecordings").empty();
\$('#streamrecordings').trigger("chosen:updated");
\$("#moviesort-button .ui-selectmenu-text .sortimg").empty();
self.getRecordings(ref,function(){
\$('#streamrecordings').trigger("chosen:updated");
});
Expand Down Expand Up @@ -291,7 +307,9 @@ var isChrome = !!window.chrome && !!window.chrome.webstore;

\$('#btnstop').button();
\$('#btnplay').button();


self.CheckPlayer();

},SortMovies: function () {

var idx = GetLSValue('webtvms','name');
Expand All @@ -309,6 +327,43 @@ var isChrome = !!window.chrome && !!window.chrome.webstore;
\$("#streamrecordings").append( options );
\$('#streamrecordings').trigger("chosen:updated");

},CheckPlayer: function () {

var live = (\$('#moviesort-button').css('display') == 'none')
var pl = self.currentp;
if(pl == 'html')
{
if (live) {
\$('#htmlPlayer').hide();
\$('#errPlayer').show();
} else {
\$('#htmlPlayer').show();
\$('#errPlayer').hide();
}
}

if(pl == 'vxg')
{
if (live && window.location.protocol == 'https') {
\$('#vxgPlayer').hide();
\$('#errPlayer').show();
} else {
\$('#vxgPlayer').show();
\$('#errPlayer').hide();
}
}

if(pl == 'vlc')
{
if (live && window.location.protocol == 'https') {
\$('#vlcPlayer').hide();
\$('#errPlayer').show();
} else {
\$('#vlcPlayer').show();
\$('#errPlayer').hide();
}
}

},getRecordings: function(_dirname,callback) {
var rdata = {fields:'f'};
if(_dirname != '')
Expand Down Expand Up @@ -362,8 +417,7 @@ var isChrome = !!window.chrome && !!window.chrome.webstore;
self._vlc.video.deinterlace.enable(val);
else
self._vlc.video.deinterlace.disable();
} catch (e) {
}
} catch (e) { }
}, setUrl: function(sref,name,live) {

try {
Expand All @@ -387,11 +441,13 @@ var isChrome = !!window.chrome && !!window.chrome.webstore;
else {
baseurl = window.location.protocol + '//' + window.location.hostname;
if (window.location.port != "")
baseurl = baseurl + ':' + window.location.port;
url = baseurl + '/file?file=' + sref + '?sid=' + sid;
baseurl = baseurl + ':' + window.location.port;
url = baseurl + '/file?file=' + sref + '?sid=' + sid;
}
}

console.log(url);

if(self._vlc) {
self._vlc.playlist.clear();
self._vlc.playlist.add(url);
Expand Down Expand Up @@ -451,6 +507,9 @@ var isChrome = !!window.chrome && !!window.chrome.webstore;
self.createVX();
\$('#vxgPlayer').show();
}

self.CheckPlayer();

}, createVX: function() {

self.vxgplayerId = 'vxg_media_player1';
Expand Down
Binary file removed screenshots/tmp.png
Binary file not shown.

0 comments on commit 4a35678

Please sign in to comment.