1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Video embedding code

Discussion in 'PHP' started by dicecities, Jun 11, 2013.

  1. #1
    Looking for the easiest way to give a video embed code without giving the actual video file url using either php or java js.
    SEMrush

    Any help is appreciated
     
    dicecities, Jun 11, 2013 IP
    SEMrush
  2. tonicc

    tonicc Active Member

    Messages:
    198
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    51
    #2
    You can serve your video as html5 or flash and later you give the users the url of an iframe.
     
    tonicc, Jun 11, 2013 IP
  3. SedNaX

    SedNaX Active Member

    Messages:
    1,326
    Likes Received:
    59
    Best Answers:
    0
    Trophy Points:
    90
    #3
    yourdomain.extension/watch?v=123

    Go to watch.php:

    $code = $_GET['v']; //123
    //123 is some unique hash of video file. In PHP, do query:
    //SELECT url FROM videos WHERE hash = {$code}

    And then you have the url. If you're really cool, place the video outside the public_html folder. Now you can also disable direct hotlinking.
     
    SedNaX, Jun 16, 2013 IP