Merhaba, kendi sunucumda barındırdığım .mp4 formatındaki videoları sitemde videojs player ile izletiyorum ancak video izlenirken internet download manager ve türevleri ile video dosyası indirilebiliyor.
.htaccess ile doğrudan indirmeleri engelledim ancak videoyu izlerken internet download manager ile indirilebiliyor.. Bunu nasıl engelleyebilirim?
Video İndirmelerini Engelleme
3
●153
- 18-01-2022, 03:17:50Youtube gibi video ve sesi ayırıp blob url oluşturarak kullanabilirsiniz.
Ya da
O player yerine https://stackoverflow.com/a/4429862/17711355 html canvas ile bir player yapabilirsiniz. Html üzerinde hiçbir video linki olmaz. - 18-01-2022, 15:34:02Hocam birde doğrudan playera custom header ekleyip o headerı video sunucusunda kontrol ettirerek engelleme yapılabiliyormuş idm ve türevleri sadece referrer kullandığı için custom headeri geçemeyip 403 e düşüyormuş bunun hakkında bilginiz var mı?Misafir adlı üyeden alıntı: mesajı görüntüle
- 18-01-2022, 16:31:05https://api.video/blog/tutorials/ins...custom-headersBWeb adlı üyeden alıntı: mesajı görüntüle
Bundan bahsediyorsunuz galiba hocam. Xhr içine session token ekliyor ancak video indirme eklentileri bildiğim kadarıyla mp4 src lerini tarıyor. Videoyu api ile de alsanız kaynakta gözükecektir.
https://stackoverflow.com/a/49955548/17711355
Bir post metodu oluşturup token vb ile video url adresini aldıktan sonra linkteki yöntem ile yeni bir url oluşturup js ile canvasa basabilirsiniz. Size örnek bir kodu aşağıda yazdım.
<!DOCTYPE html> <html lang="tr"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Document</title> <style> canvas { max-width: 100%; max-height: 100%; } </style> </head> <body> <button class="zfc">Play / Pause</button> <div class="canvas-video-zfc"> <canvas id="canvas"></canvas> </div> <script> const startPlayer = (z) => { var canvas = document.getElementById('canvas'); var ctx = canvas.getContext('2d'); var video = document.createElement('video'); video.src = z; video.addEventListener('loadedmetadata', function () { canvas.width = video.videoWidth; canvas.height = video.videoHeight; }); video.addEventListener('play', function () { var $this = this; //cache (function loop() { if (!$this.paused && !$this.ended) { ctx.drawImage($this, 0, 0); setTimeout(loop, 1000 / 30); // 30fps } })(); }, 0); video.play() document.querySelector('.zfc').addEventListener('click', () => { if (video.paused) { video.play() } else { video.pause() } }) } // bu url adresini session token post ederek json şeklinde alabilirsiniz. var zfc = startPlayer('http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4'); </script> </body> </html>