A-Frame: Is it possible to have a-videosphere have a src link to a youtube video instead of a locally stored video file? - webvr

I want to be able to do this
<a-videosphere src="https://www.youtube.com/watch?v=diBozKDxVLI" autplay="true"></a-videosphere>
Is there any way I can without pointing to a locally stored file?

You can't render a YouTube video as a texture in WebGL. YouTube does not offer an URL to extract the video source. The official player is the only way they have to place ads and monetize the service. If you could stream a video directly you would be able to freely redistribute YouTube content. Technically, it's possible to create a web service that downloads YouTube videos and expose them through a streaming endpoint but it will go against the terms of service:
https://www.youtube.com/static?template=terms

https://aframe.io/faq/#can-i-render-youtube-videos-as-a-texture
With some manual effort, you could either proxy YouTube videos as a texture or download them locally to serve, but that is against their terms of service.

Related

Is there any way to make sure that an image is not taken from google but instead the user's phone camera?

I want to only allow images that are taken directly with the phone’s camera on my website. Are there any APIs or tricks that could help me tell if an image is authentic and taken with an iPhone or Android camera a few moments ago and not taken from Google Images.
Hi drstuggels they are a few ways to go about this.
WebRTC
To prevent upload from any file, take picture directly on your web interface, via the user webcam.
You would need to
Ask permission to the user to use the webcam.
Open the video stream
Capture on click the frame
Save the frame
This would prevent lambda users from uploading picture "not live".
If this is a solution you are considering, look for WebRTC. Although there are many blog post showcasing demo for this exact use case.
Such as:
https://developer.mozilla.org/en-US/docs/Web/API/WebRTC_API/Taking_still_photos
EXIF validation
As mentioned by iѕєρєня, you could try to access the EXIF metadata of the uploaded picture and run a validation mechanism, for let say freshness but looking for date and time field (if you are looking for a newly taken photo) or the camera model field to make sure it was taken by a camera (phone, DSLR, etc..).
DISCLAIMER:
Nothing will prevent a malicious user from tampering with the js code or file to upload fake picture.

Video streaming with HTML5 video player

I'm trying to get into how the video streaming with HTML5 video player works and have some questions about that.
I have such a declaration at my HTML page
<video controls class="card-img-top">
<source src="/stream/video.mp4" type="video/mp4">
Your browser does not support the video tag.
</video>
The URL /stream/video.mp4 is handled by the Spring Boot controller which sends the data. All works fine but how I see it very inefficient.
Every time I move the slider on the video timeline to any point I see the requests with Range header like
Range: bytes=88375296-
Range: bytes=39354368-
Range: bytes=60915712-
That's mean at every video scroll I have to provide all the data from a specified point to the end of the video file. That looks really inefficient.
Is there some way to configure HTML5 player to work in more efficient way? Also, could you recommend something to read about video streaming implementation with Spring Boot?
That's mean at every video scroll I have to provide all the data from a specified point to the end of the video file.
The browsers requests all the data form the specified point to the end of the file, BUT, it can simply disconnect the TCP session to stop the downloading when a seek happens. Its is as efficient as it can be.
Is there some way to configure HTML5 player
No, When you tell the browser to play an MP4, you give ALL control to the browser. You there are no options to control how it works.
If you want more control, you can use Media Source Extensions. But then you will need to use more advanced file formats server side and implement all the details of how the player works. See HLS/DASH

HDR video (H265/HLG) uploaded through YouTube-data-api does not appear as HDR, but same file uploaded via website does

We are currently testing a new feature that generates HDR (H.265 10-bit, HLG or PG) video, and uploads using the YouTube-v3 data api. When a file is uploaded via the videos/insert API, it does not show it has having "HD" quality, but if I save the file and upload via the YouTube.com creator website, that same video will show the "HD" quality symbol. Is this a bug or something I may be missing (couldn't find anything in the API)?
Actually rechecked and it’s ok. Just doesn’t show HDR indication in Safari. Thanks for the response

How to use YouTube Data API (v3) to get more than 15 videos in an RSS reader (newsboat)?

I was wondering if you could pull more than 15 videos from a youtube channel's RSS feed (I'm using newsboat with a macro to open mpv to play the videos from the links but that's unlikely to make a difference, any RSS reader and media player that can use links should suffice for this). The default URL of https://www.youtube.com/feeds/videos.xml?channel_id=CHANNELID only gives the 15 more recent videos. I found this question: Fetching videos list from a Youtube playlist through RSS doesn't return more than 15 results and the user KENdi says to use the Google-Data-API (v3) and use the command "PlaylistItems: list" with documentation located here: https://developers.google.com/youtube/v3/docs/playlistItems/list to theoretically pull as many as 50 videos.
I have no idea what is meant by this. How do you actually apply this knowledge in practice? All I have access to is newsboats' ~/.newsboat/urls file to add links with tags to the menu so where would I actually add an implementation of some API call and would it normally give me the link so that I can play it in mpv straight from newsboat?

How to get youtube embed code with CodeIgniter?

I need to give the possibility to embed youtube videos in a website I'm developing. The admin shoud be able to insert a youtube link in a form; the url will be stored in the database and then I have to embed it in a page.
I was trying to use this library: http://codeigniter.com/wiki/YouTube_API_for_CodeIgniter/revision/12072/
But using the getVideoEntry function I get this, and I don't really know what to do with it:
tag:youtube.com,2008:video:zol2MJf6XNE2009-01-14T17:21:57.000Z2011-09-01T11:36:39.000ZSyndication of this video was restricted by its owner.DominoRecordshttp://gdata.youtube.com/feeds/api/users/dominorecordsMusicDominoRecordsA video for 'My Girls' from Animal Collective's new album Merriweather Post Pavilion. Out now on Domino. Produced by: Knowmore Productions Animated by: Jon Vermilyea Edited/VFX by: Chad Von Nauanimal collective, my girls, domino, avey tare, panda bear, geologistDEAnimal Collective - My Girls (2009)widescreen2009-01-14T17:21:57.000Zzol2MJf6XNE
And anyway, to use it, I need the youtube video id. Is there an easy way to get it, which covers all possible variations of youtube urls?
CodeIgniter seems like overkill for merely embedding videos. The YouTube functionality on the page you linked is mostly a wrapper for the YouTube Data API (which allows for extracting information about YT users, channels, videos, etc. and facilitates procedural uploading of videos). Embedding videos is as easy as dropping some HTML on your page with the correct video ID.
Here's the best answer I've seen for getting the video ID from URLs.

Resources