The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Two hotlinking questions

Discussion in 'General Discussion' started by Mr_Butter, Oct 14, 2006.

  1. Mr_Butter

    Mr_Butter Registered

    Joined:
    Oct 14, 2006
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    Hi, I run a video site called www.calvideos.org.

    I have 2 concerns right now:

    1. I have hotlinking enabled as follows:

    [​IMG]

    This is working fine. This makes it so users cannot type in say, http://video.calvideos.org/myvideo.wmv, instead they have to go through the built in waiting system and after 30 seconds the download comes up. Now the problem comes when I want to STREAM the video. When I have hotlinking enabled, the streaming system does not work. I don't know why. I know there is a way to fix this because my friend did it once when he was hosting the site, however I have changes hosts and I dont remember what he had done. I remember he did it all (I think) through the hotlinking window. No need for htaccesses or anything. But now that I have a new server that is gone and he hasnt been online for a while so I cant ask him for help.

    2. For some reason when I go to the downloadwait page and wait the time, the hotlink protection will make it so that the download DOESNT start, instead it redirects to the specified page. This ONLY happens in Internet Explorer. Firefox works fine. I dont know what's up with that.

    Thanks for any help!


    Oh I guess it might help knowing how the files (stream.php and the downloadwait.php) link to the videos...

    STREAMING
    Code:
    <EMBED type='application/x-mplayer2' pluginspage='http://microsoft.com/windows/mediaplayer/en/download/' id='Player' displaysize='-1' autosize='-1' showcontrols="true" showtracker='1' showdisplay='1' showstatusbar='-1' videoborder3d='-1' width="600" height="480"  
    src="http://video.calvideos.org/<? echo $file; ?>" autostart="true" designtimesp='5311' loop="true"></EMBED>

    DOWNLOADWAIT
    Code:
    <SCRIPT LANGUAGE="JavaScript">
    <!-- Begin
    var start=new Date();
    	start=Date.parse(start)/1000;
    	var counts=30;
    	function CountDown(){
    		var now=new Date();
    		now=Date.parse(now)/1000;
    		var x=parseInt(counts-(now-start),10);
    		if(document.form1){document.form1.clock.value = x;}
    		if(x>0){
    			timerID=setTimeout("CountDown()", 100)
    		}else{
    			location.href="http://video.calvideos.org/<? echo $file; ?>"
    		}
    	}
    //  End -->
    </script>
     
    #1 Mr_Butter, Oct 14, 2006
    Last edited: Oct 14, 2006
  2. webignition

    webignition Well-Known Member

    Joined:
    Jan 22, 2005
    Messages:
    1,880
    Likes Received:
    0
    Trophy Points:
    36
    I'm not sure why this isn't working correctly, however I do have a couple of points worth mentioning:

    1) Serving videos through a Windows Media Player plugin would, in general, restrict you users to those running Windows. A Flash-based video player would reach a far wider audience and may well be much more suitable - why else do YouTube and GoogleVideo do this?

    2) Your script that makes people wait 30 seconds to access a file is 'controlled' via JavaScript. This may well prevent those with JS disabled from accessing your content. It is also very very very very very very easy to bypass.

    Combining a Flash-based video player with some built-in ad-serving delay could possibly be a much better option if you need to both serve video clips in through your own interface and display ads before allowing a clip to be viewed. This would also negate the need to ever display a file's URL.

    You could then use a htaccess-based rewrite rule to prevent direct linking for those who do a bit of URL hacking to guess file URLs, something along the lines of /*.wmv => /player.html?clip=*
     
  3. Mr_Butter

    Mr_Butter Registered

    Joined:
    Oct 14, 2006
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    I'm not sure how to make a flash player...or else I would make one.

    As for the javascript...well....right now it's working fine but I guess I can make it better later on.

    If I switched to a flash player do you think it would stop having the hotlink streaming problems?
     
  4. nickp666

    nickp666 Well-Known Member

    Joined:
    Jan 28, 2005
    Messages:
    770
    Likes Received:
    2
    Trophy Points:
    18
    Location:
    /dev/null
    Linux users can view windows media streams with MPlayer's Browser plugin & Darwin has windows media player anyway so I'm not sure you are strictly right on this
     
Loading...

Share This Page