I use jwplayer how video player in video pages.. example - http://fff.satellite.fm/film/a-grand-pursuit/ The code for the video player include the path to the file:
var $video = jwplayer( 'video-39907' ).setup( { file : 'http://fff.satellite.fm/wp-content/fff-uploads-bucket/2016/12/MAFF-A-Grand-Pursuit-Trailer.mp4', type : 'mp4', image : 'http://fff.satellite.fm/wp-content/fff-uploads-bucket/2015/10/A-Grand-Pursuit-Vertical.jpg (Not automatically expanded because 4MB is too large. You can expand it anyway or open it in a new window.) ', mediaid : 'fBmNw3v7' } );
but if someone look to the page code they can copy and paste the video url and see/download the video.. so what I'm trying to do is server the video using a PHP script.. so I can make some checks in that PHP script to server or not the video.. on desktop the script work (at least on my side) but on iphone/ipad not work.
var $video = jwplayer( 'video-39907' ).setup( { file : 'http://fff.satellite.fm/?&nfm=play&nff=39907&nfv=43357&nfb=410237682586bfc29845444.20339093, type : 'mp4', image : 'http://fff.satellite.fm/wp-content/fff-uploads-bucket/2015/10/A-Grand-Pursuit-Vertical.jpg (Not automatically expanded because 4MB is too large. You can expand it anyway or open it in a new window.) ', mediaid : 'fBmNw3v7' } );
/** * bytes per $sec * @var int $bytes */ private $bytes = 40960;
/** * if contentType is false we try to guess it * @var mixed $contentType */ private $type = FALSE;
/** * set content disposition * @param type $file_name */ public function contentDisposition( $file_name = FALSE ) { $this->disposition = $file_name; }
/** * set throttle speed * @param float $sec * @param int $bytes */ public function throttle( $sec = 0.1, $bytes = 40960 ) { $this->sec = $sec; $this->bytes = $bytes; }
/** * set content mime type if false we try to guess it * @param string $content_type */ public function contentType( $content_type = null ) { $this->type = $content_type; }
/** * get name from path info * @param type $file * @return type */ private function name( $file ) { $info = pathinfo( $file ); return $info['basename']; }
My name is Alex and I am one of the Team Leads of the Support Team at JW Player. I will be more than happy to assist you with your questions.
Assisting with writing custom code for customers is not something that is within our scope of support. With that being said, I recommend that you take a look at the URL (Token) Signing feature we provide if you are looking for a way to protect your video URLs from being taken off of your page.
Since the video looks like it would be hosted externally, we wouldn’t be able to protect the actual video URL but you can protect the player URL. This means you can add the MP4s URL to your JW Player dashboard and then embed it using the “Embed” feature of the dashboard which will generate a single-line JavaScript library URL that is tokenized and set to expire in whatever amount of time you configure it to.
Alternatively, you can also choose to upload your MP4s to our platform which would give you the ability to also tokenize the video URLs themselves.
Please let me know if you need any more help or have any other questions.
Thank you!
This question has received the maximum number of answers.