Embedding Video Stream into webpage

2019-08-01 02:46发布

This is a progress after the question Embedding Image/Video Stream into webpage that was answered for the picture only using curl, video is still an open issue.

Resuming, I need to avoid that the visitor of a web page see the real source of an image streming. So I want to embed the video a some wrapper php page that doesnt use any userid/password but is under my control. Embedding the video stream into any HTML page it's really easy:

<img src="http://5.246.77.89:8090/videostream.cgi?user=stack&amp;pwd=overflow&amp;resolution=32&amp;rate=15" alt="">

For some time I'll give you the opportunity to test the source of the video streaming that I want to hide here

http://93.58.198.189:8090/videostream.cgi?user=stack&pwd=overflow&resolution=32&rate=15

Now all I need is a simple web page let say video.php that is able to stream the video without asking credentials and hiding the original source IP, something like

<img src='my.php'>

How can I obtain this behavior? Note that despite the source is a video stream, the header is image/jpeg as you can see by yourself and it works with any browser. I've tried to use

<?php 
header("content-type:image/jpeg"); 
passthru("http://93.58.198.189:8090/videostream.cgi?user=stack&pwd=overflow&resolution=32&rate=15"); 
?>

but for some reason doesn't work. Any idea?

1条回答
做自己的国王
2楼-- · 2019-08-01 03:13

Good question, i was also had a same problem. Now its solved for me. just you can go to you tube video url where your video is stored and below the video there is share ad embed, you go to embed and there you will get a url which can be embeded to your video.php. it works.

查看更多
登录 后发表回答