How to display video a url in php? - php

I'm trying to create a form in which a user inserts their youtube code into a field, which is then stored in mysql.
how can i display video?... while fetching data from my database it displays the video url name
How can I do it so that the link is permanently fixed in the php document and the end part is retrieved from mysql in a way that when the page is opened it displays the video correctly?
Very simple stuff when you know how to do it but I don't so I would appreciate if someone could tell me the way of doing this.
without embed only for example this url which will insert into database "https://www.youtube.com/watch?v=T95zFC4Z2pY" while retiring it by <?php echo $res['link']; ?> is there any other why except embed tag

you can use <iframe></iframe> tag. I hope it will helpful for you.
Try this:
<iframe width="420" height="345"
src="https://www.youtube.com/watch?v=T95zFC4Z2pY">
</iframe>

Since you are not giving an example of any code you have tried so far, I will not provide the code, instead I am going to point you in the direction.
Open up the youtube video Embed Tutorial
Then click on 'Share' under the description, then click on 'Embed'. Youtube will give you the code you need to embed your video.

Related

Embed soundcloud player with url

i'm actually working on a website where the users will put the soundcloud link of their tracks and there will be a player directly on the website. The problem is I have not found any solution on how to embed a soundcloud player with only the link. I can't ask my users to give me the iframe link it would not be serious i guess.
So thanks to everyone in advance !
I can't ask my users to give me the iframe link. You can change an iframe src with javascript. Just give the iframe an id. Then compose the link using js and insert the user's part into the string to be assigned to src.

Embedding Video Stream into webpage

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&pwd=overflow&resolution=32&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?
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.

Adding downloadlink using canvg and amcharts

I am trying to add a downloadlink to a page that uses AmCharts and CanVG.
The entire graph and img displaying part is all working correctly.
Now i need a downloadlink to provide the user with the image of the graph displayed.
i have already tried to create a HTML link element to the image, but at that moment, i get an error that says "Requested URI to long".
Also i have tried using a form, parsing the source from the image(obtained via jQuery) to a new page, and displaying it there, but also that won't work..
Anybody that can help me? every solution using html/php/jquery/javascript is perfectly fine.
As i have found out, this is not possible due to the length of the url. The best solution will be just to display the image in a div, next to the chart or underneath the chart, as a thumbnail. Trough there the user can just save it into their documents.

Change video id in youtube embed code with query value

what I want to do basically, is to take the parameters from the html page and place it as video ID into the youtube embedded code, so when the page loads, it shows the embedded player of the corresponding video.
How I want it to work, is to have buttons on a web page that will link to a video.html page with the video id in parameters, and load the corresponding video.
I know I probably have to use javascript or php, but I don't know both of them so explain as clearly as possible please. So I want to replace "VIDEOID" with my query string as simply as possible.
<iframe width="560" height="315" src="http://www.youtube.com/embed/"VIDEOID" frameborder="0" allowfullscreen></iframe>
thanks in advance.
Try to follow this code to get parameter value from url in html
Hope its helpful for you..

YouTube embed and PHP

I allowed the user to upload a YouTube embed link that will display the video on their profile page. However, as my current code runs, it does not work. I echoed the field successfully from the database that holds the youtube embed link so I know the php code is working in terms of extracting the link. I then replace the PHP code and put the actual link in the src attribute but it still does not work. Here is the code below.
<iframe width="420" height="315"
src="<?php echo $detailed_profile_data['video_1'];?>"
frameborder="1" allowfullscreen>
</iframe>
The function detailed_profile_data grabs the link the user submitted to the database.This is what it returns. youtu.be/yWk7FOnFvGs
You might want to use oEmbed to find out the actual embeddable URL from the URL that user submits.
This Stack Overflow article might help: How can I retrieve YouTube video details from video URL using PHP?

Categories