Kodi Community Forum
Release CetonTV+HDHomeRun - Watch TV on XBMC (WIN/OSX) - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33)
+--- Forum: Add-on Support (https://forum.kodi.tv/forumdisplay.php?fid=27)
+---- Forum: Program Add-ons (https://forum.kodi.tv/forumdisplay.php?fid=151)
+---- Thread: Release CetonTV+HDHomeRun - Watch TV on XBMC (WIN/OSX) (/showthread.php?tid=119865)



- europorsche914 - 2012-02-24

see: this post


Issue with remoteCeton application - CrazyChicken132 - 2012-02-24

I'm not sure what is wrong with either my setup, only getting the startup and the found tuner lines in the window and nothing else.

Image

Any Ideas?


- mcheng89 - 2012-02-24

Can you send me a copy of the web page:
http://<ceton ip>/Services/ChannelMap.html

I couldn't find a upnp call for the channel map, so I just rip it off the HTML.

Also, can you send me the resources/channelmap.csv file, if it exists.


- mcheng89 - 2012-02-24

europorsche914 Wrote:so I spent the last 12 hours getting epg data parsed into a table that correctly handles time zone differences of the host/client computers (if client is in a different timezone it will still show epg data of the host computer or atleast that is how its suppose to work, I havent tested it yet), It also adjusts for am/pm and shows 10 channels at a time, feel free to use any of this code as needed and it is by no means a finished web epg, I will update this post as I continue to improve this code.

To modify this code to fullfill your needs the channellist should list the channels you would like to display guide data for, and chlindex is how many channels you want to guide for minus one (10 channels, chlindex=9) also modify xmlhttp.open to the ip address running the remoteceton api. Im too tired right now to streamline it anymore, let me know if there are any issues

Code:
<html>
<head>
<script language="javascript" type="text/javascript">
  var currentTime = new Date();

  var tzone = currentTime.getTimezoneOffset()/60;
  var currentHours = currentTime.getHours()+tzone-5;
  var currentMinutes = currentTime.getMinutes();

  // Pad the minutes and seconds with leading zeros, if required
  currentMinutes = ( currentMinutes < 10 ? "0" : "" ) + currentMinutes;

  // Choose either "AM" or "PM" as appropriate
  var timeOfDay = ( currentHours < 12 ) ? "AM" : "PM";

  // Convert the hours component to 12-hour format if needed
  currentHours = ( currentHours > 12 ) ? currentHours - 12 : currentHours;

  // Convert an hours component of "0" to "12"
  currentHours = ( currentHours == 0 ) ? 12 : currentHours;


function getEPGData() {
    if (window.XMLHttpRequest)
    {// code for IE7+, Firefox, Chrome, Opera, Safari
        xmlhttp=new XMLHttpRequest();
    } else
    {// code for IE6, IE5
        xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
    }
    [b]xmlhttp.open("POST","http://******:8555/getEPGData",false);[/b]
    var timeoff = new Date().getTimezoneOffset();
    var ctime = (new Date().getTime()+(timeoff*60000)-(5*3600*1000));
    var start_time = ctime/1000;
    var end_time = (parseInt(ctime/1000)+5400);

    var myEPG = new Array();

        
    [b]channellist = "3,6,8,10,12,13,14,15,477,551";[/b]

    xmlhttp.send("{\"start_time\":"+start_time+",\"end_time\":"+end_time+",\"channels\":["+channellist+"]}");
    xmlDoc=xmlhttp.responseText;
    currenttable="<table border='1'><tr><th>Channel</th><th>"+currentHours+":"+currentMinutes+" "+timeOfDay+"</th><tr>";
    tempstr=xmlDoc.substr(2);
    tempindex=tempstr.indexOf('"');
    var chlindex=0;
    var i=0;

    while ([b]chlindex<=9[/b]) {
        while (tempindex>=1) {
            myEPG[chlindex,0+i]=tempstr.substring(0,tempstr.indexOf('":'));
            tempstr=tempstr.substr(tempstr.indexOf("program_title"));
            myEPG[chlindex,1+i]=tempstr.substring(16,tempstr.indexOf('",'));
            tempstr=tempstr.substr(tempstr.indexOf("start_time"))
            myEPG[chlindex,2+i]=parseInt(currentMinutes)-(Math.floor(((ctime/1000)-parseInt(tempstr.substring(12,tempstr.indexOf(',"'))))/60));
            tempstr=tempstr.substr(tempstr.indexOf("end_time"))
            myEPG[chlindex,3+i]=parseInt(currentMinutes)+Math.ceil(Math.abs(parseInt(tempstr.substring(10,tempstr.indexOf('}'))-(ctime/1000))/60));
            tempstr=tempstr.substr(tempstr.indexOf('"'));
            myEPG[chlindex,4+i]=currentHours;
            myEPG[chlindex,5+i]=timeOfDay;
            myEPG[chlindex,6+i]=currentHours;
            myEPG[chlindex,7+i]=timeOfDay;

            while ((myEPG[chlindex,2+i]/-60)>=1) {
                myEPG[chlindex,4+i]=myEPG[chlindex,4+i]-1;
                myEPG[chlindex,2+i]=myEPG[chlindex,2+i]+60;
            }
            while ((myEPG[chlindex,2+i]/60)>=1) {
                myEPG[chlindex,4+i]=myEPG[chlindex,4+i]+1;
                myEPG[chlindex,2+i]=myEPG[chlindex,2+i]-60;
            }
            myEPG[chlindex,2+i]=Math.abs(myEPG[chlindex,2+i]);

            while ((myEPG[chlindex,3+i]/60)>=1) {
                myEPG[chlindex,6+i]=myEPG[chlindex,6+i]+1;
                myEPG[chlindex,3+i]=myEPG[chlindex,3+i]-60;
            }


            if (myEPG[chlindex,4+i]<1) {
                myEPG[chlindex,4+i]=12+myEPG[chlindex,4+i];
                if (myEPG[chlindex,5+i]="AM")
                    myEPG[chlindex,5+i]="PM";
                else
                    myEPG[chlindex,5+i]="AM";

            }

            if (myEPG[chlindex,6+i]>12) {
                myEPG[chlindex,6+i]=myEPG[chlindex,6+i]-12;
                if (myEPG[chlindex,7+i]="AM")
                    myEPG[chlindex,7+i]="PM";
                else
                    myEPG[chlindex,7+i]="AM";
        
            }

            if (myEPG[chlindex,4+i]==12) {
                if (myEPG[chlindex,5+i]=="PM")
                    myEPG[chlindex,5+i]="AM";
                else
                    myEPG[chlindex,5+i]="PM";
            }

            if (myEPG[chlindex,6+i]==12) {
                if (myEPG[chlindex,7+i]=="PM")
                    myEPG[chlindex,7+i]="AM";
                else
                    myEPG[chlindex,7+i]="PM";
            }

            if (myEPG[chlindex,2+i]<=9)
                myEPG[chlindex,2+i]="0"+myEPG[chlindex,2+i];

            if (myEPG[chlindex,3+i]<=9)
                myEPG[chlindex,3+i]="0"+myEPG[chlindex,3+i];
            if (myEPG[chlindex,0+i]!="")
                currenttable=currenttable+"<td ALIGN=Center>"+myEPG[chlindex,0+i]+"</td>";

            currenttable=currenttable+"<td ALIGN=Center>"+myEPG[chlindex,1+i]+"\n"+myEPG[chlindex,4+i]+":"+myEPG[chlindex,2+i]+myEPG[chlindex,5+i]+"-"+myEPG[chlindex,6+i]+":"+myEPG[chlindex,3+i]+myEPG[chlindex,7+i]+"</td>";

            tempindex=tempstr.indexOf('{"');
            if (tempstr.indexOf(',{"')!=0)
                i=i+10;
                if (tempstr.indexOf(',"')<=tempindex) {
                    tempindex=tempstr.indexOf('{"');
                    i=0;
                    chlindex=chlindex+3;
                    currenttable=currenttable+"</tr><tr>";
                    tempstr=tempstr.substr(tempstr.indexOf('],"')+3);
                }
        

        }
    }
    document.getElementById("epg").innerHTML=currenttable+"</tr></table>";
    xmlhttp.close;
}
</script>
</head>
<body onload="getEPGData()">
<div id=epg></div>
</body>
</html>

Hmm... Maybe a
Code:
var obj = eval('(' + xmlDoc + ')');
Would work too... (forgot about this)


- CrazyChicken132 - 2012-02-24

The resources/channelmap file doesn't exist just the m2xml stuff.

The other file is reachable at this link.

Channel Map.zip


- mcheng89 - 2012-02-24

CrazyChicken132 Wrote:The resources/channelmap file doesn't exist just the m2xml stuff.

The other file is reachable at this link.

Channel Map.zip

Sorry I gave you the wrong URL.
It's this one: http://<ceton_ip>/view_channel_map.cgi?page=0


- CrazyChicken132 - 2012-02-24

No worries, new link below.

Channel list


- mcheng89 - 2012-02-24

CrazyChicken132 Wrote:No worries, new link below.

Channel list

I'll let you know when I get home. Have to check if there's an issue parsing your channel map... Won't be until tonight

Also, gonna release a newer iPhone layout...


- CrazyChicken132 - 2012-02-24

Sounds, good.

I can setup remote access if you would like and Visual Studio 2010 on the box, if it will help.


- CrazyChicken132 - 2012-02-24

Got it working after installing the latest firmware update for the card...

Also installed visual studio so it may have been a combination of a couple things.


- mcheng89 - 2012-02-24

CrazyChicken132 Wrote:Got it working after installing the latest firmware update for the card...

Also installed visual studio so it may have been a combination of a couple things.

I actually don't have visual studio, so I'm guessing it was the firmware.


- CrazyChicken132 - 2012-02-24

The channel map files are identical between the 2 different firmwares, so I wonder what was causing it.

Anyhow much appreciated for the assistance!


- uspino - 2012-02-25

So did you find a way to allow selection of favorite channels?
How's everything coming up?


- mcheng89 - 2012-02-25

uspino Wrote:So did you find a way to allow selection of favorite channels?
How's everything coming up?

Gonna start again right now Smile

Removed input channel tab. Replaced with search button
Image


Todo:
- Finish Favorites

Requoting this to remind me:
uspino Wrote:A few things/ideas:

- A lot of (small) .ts files remain in the webfiles folder. Should there be a clean up line in the code?

- It would be good to be able to select the temp folder for the transcoding files.

- Are you thinking about a different interface for iPhone/iPad (on iPad looks extremely small)

- Is there a way to start a video stream on an iOS device from a shortcut containing channel & transcode settings, the same way you can do it on VLC? That would be fantastic: you could create a shortcut to, say, ESPN, and just start streaming, or we could create a folder with shortcuts to favourite channels (and there are free apps on the store to assign a logo to each shortcut)



Current Bitrates:
"720":["1250","1500","1750"],
"576":["1000","1200","1400"],
"480":["800","1000","1200"],
"320":["500","600","800"],
"240":["300","400","500"]


- uspino - 2012-02-25

mcheng89 Wrote:Gonna start again right now Smile

Removed input channel tab. Replaced with search button
Image

Smart!

Love the colors, by the way.

How about (don't kill me) a few lines in the code to let the user to put channel logos in a folder to be rendered next to the channel name. This is how Hauppauge does it: it looks for small "jpg", "gig" or "png" files in a folder named "logos", and they have to have exactly the same name as the channel name. If it finds a logo ("CNNHD.png"), it shows it... It's a trade-off for the end user: you want channel icons? .... go find them, rename them, and put them in this folder. You can do it only for favorites so they stand out... I think that would be really cool.

Edit:

Quote:Current Bitrates:
"720":["1250","1500","1750"],
"576":["1000","1200","1400"],
"480":["800","1000","1200"],
"320":["500","600","800"],
"240":["300","400","500"]

You should definitely allow higher bitrates in 720. First: iPad. Second: Don't think about the iPhone, think about the iPhone gloriously sending the video to an AppleTV...