1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Playing recordings using Webif vlc plugin from outside the local network

Discussion in 'HD/HDR-FOX T2 Customised Firmware' started by JohnPHackworth, Oct 6, 2012.

  1. JohnPHackworth

    JohnPHackworth New Member

    Hi,

    Objective: Playing recordings using the built in VLC plugin in Webif from outside my home network.

    I've set up my router to port forward port 80 to the Humax box and can successfully access the Webif from a computer external to my network using Dynamic DNS from dyndns.org.

    I've also set the router to port forward port 9000 so that the DLNA requests are passed through.

    But: when I try to play the recording, the VLC plugin starts, but never plays the video.

    Looking at the source code for the web page that contains the embedded vlc player, it calls the player with the DLNA URL of the right recording, but the URL uses the internal network IP address of the Humax box so of course, the VLC player never finds the file.

    Is there any way I can specify Webif to passthrough the URL from the client that is connecting (i.e. my *.dyndns.org domain name), rather than the local IP address? Or will this need a small amount of development / recoding? I can't find anything in the Webif settings on this.

    Thanks,

    John Percival Hackworth
     
  2. Black Hole

    Black Hole Felonius Gru

    You have a major problem: upstream bandwidth. You may well have 10Mbps download speed, but what is your upload speed?
     
  3. JohnPHackworth

    JohnPHackworth New Member

    Hi,

    Apologies, but I have already stated the major problem.

    my download speed is usually between 40 - 60 Mbps and upload speed of between 12 - 18 Mbps.

    The problem is that Webif forms the DNLA URL using the internal network IP address, rather than using the domain name that was used to access webif. The ability to set a domain name for the Webif server with the option to use this in constructing the DNLA URL would alleviate this.

    If there is an answer without any development work I would be oleased to hear it.

    Cheers,

    JPH
     
  4. af123

    af123 Administrator Staff Member

    There isn't currently a way to change that IP without modifying the source code. The file you need to change is /mod/webif/lib/system.class and within that the system ip procedure which looks like this by default:

    Code:
    proc {system ip} {} {
            if {[catch {set fp [open /etc/hosts r]}]} {
                    set ip "127.0.0.1"
            } else {
                    set ipl [lindex [split [$fp read] "\n"] 1]
                    regsub -- {[[:space:]].*} $ipl "" ip
            }
            return $ip
    }
    
    You could replace it with just:

    Code:
    proc {system ip} {} {
            return "myname.dyndns.org"
    }
    
    That would, of course, break playback on the local network.
     
  5. RedEarth

    RedEarth Member

    Can the html which gets served not just include a relative hyperlink? That way it wouldn't need to know the dyndns host name, the browser at the other end would sort that out. Or does the fact that the URL needs the port number prohibit this?
     
  6. Black Hole

    Black Hole Felonius Gru

    Wow! I presumed your upload would be in the order of 100k, hence the reply. Sorry.
     
  7. af123

    af123 Administrator Staff Member

    Correct - having to add the port number complicates it.
     
  8. JohnPHackworth

    JohnPHackworth New Member

    Thanks for the insights.

    In my view there needs to be somewhere in the settings where one can enter the domain name for outside access (like myserver.dyndns.org), then some code on the server side that examines the calling web client URL, determines if it is a local or external connection, then substitutes either the local IP address or the defined domain name depending on its result, appending the '9000' port number so that the returned HTML page code contains the appropriate link.

    I'm not a coder (at least not for a loooong time!) so do not know the appropriate syntax, but this seems to be a relatively easy thing to do and would extend the use of Webif to outside networks, very much in the way that commercial products like Slingbox (can't post a link till I have 10 posts!) do.

    I'm sure there are others aside from me who would appreciate this enhancement.

    Thanks,

    JPH
     
  9. af123

    af123 Administrator Staff Member

    The most appropriate place to fix this would likely be in javascript running within the browser. The browser knows the URL that's in the address bar so can create an appropriate DLNA URL

    I will look at whether this can be done in a future release.
     
  10. JohnPHackworth

    JohnPHackworth New Member

    Great! I look forward to it!

    Meanwhile, I've tested the concept by manually entering the network stream into a standalone VLC player by copying the DNLA link and changing the internal IP address to my Dynamic DNS address. Works a treat!!

    I still think this would be better done by defining the Domain name in the Webif settings and generating the appropriate link server side, depending on what was called.

    Cheers,

    JPH