Support » Miscellaneous » Different Links/Videos based on Visitor's Country

Different Links/Videos based on Visitor's Country

  • Hi, I embed youtube video in my wordpress blogs, but since Youtube videos are blocked in some countries, I also put the videos on my own server. However, this means that on the same post, I would show 2 links/videos: one from youtube, and another from my server.

    Is there anyway I can detect what country the visitor is from and then show just one link to the correct video?

    The reason I don’t want to show both is they don’t look good and also I don’t want visitors who can use youtube to use my server video because that will use up my limited bandwidth.

    Thanks in advance for any help/suggestion!

Viewing 1 replies (of 1 total)
  • I suppose YouTube uses a geoIP database or service to identify the country of the connection to YouTube. If you search the Internet you will find several geoIP databases and services.

    They do not tell you where the visitor is from, only where the visitor is connecting to your website from. For example, a person from China might be in a hotel in the UK, connecting through an ISP in France to a proxy in Australia. Your website (and YouTube) will only know about the connection from Australia.

    Perhaps a better way is to use JavaScript code to detect dynamically when YouTube blocks the video, but I do not know whether that is possible.

Viewing 1 replies (of 1 total)
  • The topic ‘Different Links/Videos based on Visitor's Country’ is closed to new replies.
Skip to toolbar