Forum

Please I Need Help Im New on Nimble Streamer

nadine 2019-01-18 12:52:39 UTC in Paywall: WMSAuth and beyond

Hi Please Im real Noob i want to stream a video file i have Url Like This
http://xx.xx.xx.xx:8081/dll/b9fe490a1278f92a8165c70bf5b0f1ef.mp4/playlist.m3u8

i need it to be like this

http://xx.xx.xx.:8081/vod/sample.mp4/playlist.m3u8?wmsAuthSign=c2VydmVyX3RpbWU9NS80LzIwMTIgODozMzowNSBBTSZoYXNoX3ZhbHVlPXE3MjN6aEVmdGFUOUJoWjBQTmw1TVE9PSZ2YWxpZG1pbnV0ZXM9MjA2

i have see the toutrial here https://blog.wmspanel.com/2013/11/nimble-streamer-protect-hotlinking-domain-lock.html

i dont know where to put this code and how to deal with it

<?php
$today = gmdate("n/j/Y g:i:s A");
$initial_url = "http://stream.company.com:8081/vod/sample.mp4/playlist.m3u8";
$ip = $_SERVER['REMOTE_ADDR'];
$key = "defaultpassword"; //this is also set up in WMSPanel rule
$validminutes = 20;

$str2hash = $ip . $key . $today . $validminutes;
$md5raw = md5($str2hash, true);
$base64hash = base64_encode($md5raw);
$urlsignature = "server_time=" . $today ."&hash_value=" . $base64hash. "&validminutes=$validminutes";
$base64urlsignature = base64_encode($urlsignature);

$signedurlwithvalidinterval = "$initial_url?wmsAuthSign=$base64urlsignature";
?>

i use videojs to stream my m3u8 ive made a rule to protect against progressive download but when i play the stream i get a video.ts file grapped by idman this is another problem i want to resolve it

Denis Slobodskoy 2019-01-22 04:12:31 UTC 

This code should be on your test player page, and you should replace stream URL with signed version like this:
<video src="<?=$signedurlwithvalidinterval?>">
Player page should be handled by PHP - in some cases it enouth to give .php extension, but it depend on server config.

nadine 2019-01-22 19:01:21 UTC 

Thank You Bro FOr Your reply But IStill Get NOthing i see The player But its doesnt play anything this is the code i make inse a file.php
please correct me

<?php
$today = gmdate("n/j/Y g:i:s A");
$initial_url = "http://XX.XXX.XX.XXX:8081/dll/Sisters5a6405a05925ee26303ee76459b52c3cBrothers.mp4/playlist.m3u8";
$ip = $_SERVER['REMOTE_ADDR'];
$key = "19866687"; //this is also set up in WMSPanel rule
$validminutes = 20;

$str2hash = $ip . $key . $today . $validminutes;
$md5raw = md5($str2hash, true);
$base64hash = base64_encode($md5raw);
$urlsignature = "server_time=" . $today ."&hash_value=" . $base64hash. "&validminutes=$validminutes";
$base64urlsignature = base64_encode($urlsignature);

$signedurlwithvalidinterval = "$initial_url?wmsAuthSign=$base64urlsignature";
?>
<video id=example-video width=960 height=540 class="video-js vjs-default-skin" controls>
<source
src="<?=$signedurlwithvalidinterval?>"
type="application/x-mpegURL">
</video>
<script src="video.js"></script>
<script src="videojs.hls.min.js"></script>
<script>
var player = videojs('example-video');
player.play();
</script>

nadine 2019-01-22 19:15:08 UTC 

Thanks Its work Now I change
src="<?=$signedurlwithvalidinterval?>"

on my code with

<video src="<?=$signedurlwithvalidinterval?>">
and its work now thank you

Post a reply


Post a new question

Categories:

This website or its third-party tools use cookies, which are necessary to its functioning and required to achieve the purposes illustrated in the Privacy Policy. If you want to know more or withdraw your consent to all or some of the cookies, please refer to the Privacy Policy.
By closing this banner, scrolling this page, clicking a link or continuing to browse otherwise, you agree to the use of cookies.