Current location: Hot Scripts Forums » Programming Languages » PHP » hiding the file path in the media player


hiding the file path in the media player

Reply
  #1 (permalink)  
Old 07-12-09, 05:04 PM
Wanasa Wanasa is offline
Newbie Coder
 
Join Date: Oct 2008
Posts: 90
Thanks: 0
Thanked 0 Times in 0 Posts
hiding the file path in the media player

hi everyone,

it there any possible way to hide the video file path in the media player that runs on html page ?
HTML Code:
<object ... >
<!-- one of tags holds the file source -->
</object>
thankx in advance ,
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #2 (permalink)  
Old 07-12-09, 06:10 PM
wirehopper's Avatar
wirehopper wirehopper is offline
-
 
Join Date: Feb 2006
Posts: 2,516
Thanks: 20
Thanked 109 Times in 106 Posts
You could use some sort of encoding - but since it is all javascript, anyone can decode it.

Since you posted this under PHP - you could copy the video file to a temporary file and deliver the temporary file to the client. Be sure to clear the temporary files periodically to avoid filling up the disk.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #3 (permalink)  
Old 07-12-09, 07:56 PM
Wanasa Wanasa is offline
Newbie Coder
 
Join Date: Oct 2008
Posts: 90
Thanks: 0
Thanked 0 Times in 0 Posts
I've liked the idea of temporary file. its cool. thanks man that was so helpful.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #4 (permalink)  
Old 07-12-09, 08:06 PM
Wanasa Wanasa is offline
Newbie Coder
 
Join Date: Oct 2008
Posts: 90
Thanks: 0
Thanked 0 Times in 0 Posts
Mmmm,

if i made a temporary video file or sound file and pass it to the media player. the page loads and the media player will start buffering. the script ends the temporary file is removed. but the media was buffering. Wont that stop the media player from buffering , cause the file is not there now, right ?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #5 (permalink)  
Old 07-12-09, 08:26 PM
wirehopper's Avatar
wirehopper wirehopper is offline
-
 
Join Date: Feb 2006
Posts: 2,516
Thanks: 20
Thanked 109 Times in 106 Posts
This command will delete all files that are more than 24 minutes old - it should do the trick for you.

cd /path/to/sessions; find -cmin +24 | xargs rm;

You'll want to run it as a cron job, every 5 minutes should do.

So, the temporary file will exist for about 30 minutes, then be removed.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #6 (permalink)  
Old 07-12-09, 08:27 PM
Wanasa Wanasa is offline
Newbie Coder
 
Join Date: Oct 2008
Posts: 90
Thanks: 0
Thanked 0 Times in 0 Posts
i've looked over and found this code
PHP Code:

$filename tempnam(sys_get_temp_dir(), 'filePrefix'); 

how can i pass it to the <object> cause i think it accept file only. how to do this ?
again, thank you so much for your help.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #7 (permalink)  
Old 07-12-09, 10:14 PM
Wanasa Wanasa is offline
Newbie Coder
 
Join Date: Oct 2008
Posts: 90
Thanks: 0
Thanked 0 Times in 0 Posts
hi wirehopper,

i just sow your last reply. that a great sullotion for the problem. but i don't know how to do corn jub thing. i'll try to google on that. but what about the the problem in the last reply of mine ?

thankx a lot you've been so helpful
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #8 (permalink)  
Old 07-13-09, 09:12 AM
Wanasa Wanasa is offline
Newbie Coder
 
Join Date: Oct 2008
Posts: 90
Thanks: 0
Thanked 0 Times in 0 Posts
i did the temprory file thing with the function tempnam() . but it generate a random name after the file name extinsion. the code is :

PHP Code:

            # create a temporary file
            
$tmpfile tempnam(sys_get_temp_dir(), 'test.mp3');
            
            
# wanted file path
            
$oregonalFile 'uploadedfile/test.mp3';
            
            
# read the wanted file
            
if(file_exists($oregonalFile)) {
                
$handle = @fopen($oregonalFile"r");

                if(
$handle) {
                    
$content "";
                    
                    while (!
feof($handle)) {
                        
$content .= fread($handle,10000);
                    }
                    
                    
$write fopen($tmpfile"w");
                    
fwrite($tmpfile$content);
                    
                    
fclose($handle);
                    
fclose($temfile);
                }
            }
            
            
// this variable to use in the player template 
            
$filevars['FILEURL'] = $tmpfile
this is the source i get back :

HTML Code:
	<embed name='avplayer'

		         src='/tmp/test.mp3KDCnKF'

		         width='100%' height='40'  type='audio/x-pn-realaudio-plugin'

		         controls='ControlPanel,StatusBar' pluginspage='www.real.com'

		         autostart='True' loop='0'> 
	</embed>
see the source ! /tmp/test.mp3KDCnKF and the player dont start cause its not an MP3 file.

thankx in advance,
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #9 (permalink)  
Old 07-13-09, 09:27 AM
Wanasa Wanasa is offline
Newbie Coder
 
Join Date: Oct 2008
Posts: 90
Thanks: 0
Thanked 0 Times in 0 Posts
i used this code, and it working great. but the file is not playing. i don't know way !!
PHP Code:

            rename($tmpfilesubstr($tmpfile0, -6));
            if(
file_exists(substr($tmpfile0, -6)))
                
$filevars['FILEURL'] = substr($tmpfile0, -6);
            else
                
$filevars['FILEURL'] = "error"
the source i get back is this :
HTML Code:
	<embed name='avplayer'

		         src='/tmp/demo___aw3edak.rm'

		         width='100%' height='40'  type='audio/x-pn-realaudio-plugin'

		         controls='ControlPanel,StatusBar' pluginspage='www.real.com'

		         autostart='True' loop='0'> 
	</embed> 
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #10 (permalink)  
Old 07-13-09, 09:07 PM
Wanasa Wanasa is offline
Newbie Coder
 
Join Date: Oct 2008
Posts: 90
Thanks: 0
Thanked 0 Times in 0 Posts
i've solved it.

i created a new dir to store the files in it. and used cornjob to remove it every 10 minuts as you talled me . thankx a lot
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Hello all, can you help me? K4ot1K Other Languages 2 01-23-09 06:23 AM
Upload file to table so ONLY files tied to primary key are displayed in record? grafixDummy PHP 4 12-20-03 05:28 PM


All times are GMT -5. The time now is 09:10 PM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.