I was wondering if it was possible to make a video player in JavaFX that can play a video the user find on youtube legally.
If it is legal and possible how do I so find the link to the video xx.
As far as I know you can legal link the video as long as it is set as embed-able. In javafx you can load YouTube videos with a webview like this:
final WebView browser = new WebView();
final WebEngine webEngine = browser.getEngine();
webEngine.load("https://www.youtube.com/embed/-ppPl182K30");
You can replace //www.youtube.com/embed/-ppPl182K30 with the embed url of the video you want to play.
If you dont know where to find it this is a picture of where it is on the YouTube video page http://goreserva.com/images/youtube-embed-url.jpg
Keep in mind dont remove the https: or else the video wont load and It may take a few seconds for the video to load.
I hope this helped!
Related
I am trying to create a page with a standard youtube iframe player. It will play a video and when the first video finishes, it will use loadVideoById to load and play a second, and then after it finishes a third video.
The problem I have is that since I have partially watched the second (and third) video while signed into my youtube account, when the second (and third) video plays, it picks up from where I left off watching it on youtube, instead of starting from the beginning, and I don't want this to happen to anyone else who visits the site.
If I open the page in an incognito window it works as expected, so I know my code is good. If I just use an iframe and embed the video using youtube-nocookie.com as the domain (instead of just youtube.com) the videos start from the beginning. I could get away with using this method except I can seem to detect when the first video ends so I can change the iframe's source to start the next video.
I'm looking for any advice on either being able to detect when a youtube video ends in an iframe, or a way of using the full player with no cookies, or something (anything) else that will accomplish this task.
I have been trying to show a youtube video inside an a-frame entity. When I use the a-video tag it gives a CORS error.
<a-video src="https://youtube.com/..."></a-video>
I have tried the a-link but nothing seems to happen
<a-link src="https://youtube.com/..."><a-link>
I would like the user to click on the plane (wall) to play a video. Any suggestions on how this can be achieved.
Thanks
Raj
The official a-frame FAQ says this:
No. You could proxy YouTube videos as a texture or download them locally to serve, but that is against their terms of service.
Check out the the second link for a proof-of-concept.
I think they only want you to embed their videos via the iframe embed code you get when you right click a video on youtube and then hit "Copy embed code", and that would not work in aframe as far as I know.
Can anyone help me on how to detects when a YouTube video has finished playing? I planned to play the next video on the list whenever it detects the current video has already done playing. The YouTube player have the change event that detect when the video is done but I can't find a solution to do it on JavaFX when it using Webview 2.0.
Thank you in advance!
I am in the middle of an application that has a module to play videos from a directory on the same web-server. Everything is fine, except for the point that, while video is streaming, if I try to drag the player tip to an intermediate point, it either drags back to where it was(in flex player) or keeps loading un-till the video actually approaches that point(in case of jw-player or html5 player) or does nothing(in some other online players available). My client wants to be able to play or start buffering from any desirable point. I read something about RTMP to be used for such thing, but wasnt able to find a direct guide over how to do it.
Help appreciated!
If you're talking about being able to load a video file from x seconds in to the video, you should look into http pseudo-streaming. Here's a link to the jwplayer page about it: jwplayer pseudo-streaming
I need to implement a video player that should play files(wmv, mpeg, mp4 etc..), I have tried object tag, but it requires media player plugin to play I dont want this kind. Somebody can suggest me.
Thanks in advance.
For playing Video in Website, the users need to download plugin (WMP or any other player). Without the plugin, Video cannot stream or play in browser.