Unity & Daydream - Stream videos from youtube - unity3d

How would I go about adding youtube video to a unity project?
Im playing around with Google's Daydream and have setup the video example:
https://developers.google.com/vr/video/video-overview
The next thing I would like to do is play a video from youtube.
What would be involved in doing this?
I can see other people are doing it for example: https://www.assetstore.unity3d.com/en/#!/content/29704
thanks.

I don't think there is an "official" way to do this right now.
Take a look at YouTubeExtractor (https://github.com/flagbug/YoutubeExtractor) to see what would be involved - although this only handles the download, not really the streaming component.
-Tom

Related

Custom audio control for ios apps

We are creating an app using Swift on IOS that needs to use custom audio controls: a play button, a stop button, a current time/pos indicator, the duration and perhaps even a seek bar to play 1 audio file that is built into the application. My friend has worked hard on this project but so far was unable to find a solution. Is it possible using mediaplayer or is another api easier, possibly something similar to exoplayer for android apps.
Thanks.
In my opinion I would say that using AVFoundation would probably be easiest since it is built into swift you just have to do import AVFoundation and you would probably want to create an AVAudioPlayer to listen to the music. Also the API is pretty simple. If you need any help getting started I found this article on Mashable that shows how to play audio and how to control it with a custom play and pause button. https://medium.com/yay-its-erica/creating-a-music-player-app-in-swift-3-53809471f663. Also I found on Apple's documentation how to get the current time of the audio playing https://developer.apple.com/documentation/avfoundation/avaudioplayer/1387297-currenttime. I hope I was able to help and if you have anymore questions don't hesitate to ask!

iOS video player metadata

My question is if there is any built-in interpretation of metadata by the video player in iOS. I know one can add meta-data to a video and interpret it within a custom application as shown here.
In iOS on ipod or iphone, an HTML video is opened within the native player. I would like to display a message above or below the video for a short duration at the beginning. Since I cannot control the native player I thought there might be some built in metadata interpretation that could be used to perform this. I have not been able to find any information on this.
Any help is appreciated.
The blog you've posted includes details on using the native player MPMoviePlayerController to display meta data, which is pretty cool actually. You learn something new every day! If you're making a Phonegap App I suppose you could write a plugin to do this?
Or alternatively, have a look at this other OS question which appears to suggest that it is possible - though not seemingly with metadata embedded in the actual video. Apparently this works on iOS.
Reading metadata from the <track> of an HTML5 <video> using Captionator

tutorial using gstreamer for saving photos and videos from web cam

I know that i have to use gstreamer for creating an application to capture photo and videos
from web cam. But, i could not find any documentation describing vividly the steps for creating the
same. It will be very pleased,if any one could helped me in this.
Regards,
iSight
There is a GNOME/vala tutorial in the work that shows you how to make a Gtk application to grab pictures:
https://developer.gnome.org/gnome-devel-demos/3.10/magic-mirror.vala.html.en
Saving a video is left for you to do, you'll have to use a tee to have both live preview and recording simultaneously.
Also, there is a high-level object, camerabin, for your case, but I never used it myself.
Camerabin is being used by libcheese, that is even higher level and depends on Clutter (but not Gtk), and allows you to plug effects with cheese_camera_set_effect().
Pick what you need!

playing streamed content in an app

I have a number of music tracks which I would like the user to be able to preview a small clip of each.
These tracks are on a server.
How is media streamed into the app and which player is used? Can a custom player be created to play the clips within the view, without e.g. quicktime player opening?
Thanks
If you don't want to use QuickTime, the matter is rather complex, as far as I know. Fortunately, a lot of work already has been done for you by Matt Gallagher. See this excelent post for further information. The code, that he provides works perfectly in my application.

Can we play only audio using youtube api for iPhone

In my project i have to use youtube api and play only audio of the video. We must not show the youtube player. Is it possible to play only audio without showing video using youtube api?
Extraction may be the incorrect implied word here. From what I understand, is user133611 wants to have an audio only stream from YouTube. Unfortunately, YouTube directly forbids it. Here is a quote from Kuan Yong from the YouTube API team:
Your API Client will not, and You will not encourage or create
functionality for Your users or other third parties to:
"separate, isolate, or modify the audio or video components of any YouTube audiovisual content made available through the YouTube API"
-Kuan Yong, YouTube API Team
Link reference: https://groups.google.com/group/youtube-api-gdata/browse_thread/thread/7fac8e8ff913b6c4?pli=1
I don't think this is really possible only using Youtube API. The Youtube API is not intended to be used for "downloading" videos/audio from them. You should go here, to understand what the Youtube API is really about.
A small abstract:
Unless I am missing something really big, the Youtube API consists of 5 main parts:
Data API
Custom Player
YouTube Direct
Player APIs
Widgets
None of this APIs allow you to for example "download" a video. Also I think (correct me if I'm wrong), that in a youtube video, the audio is actually embedded in the flash video, making the task even less trivial.
To illustrate you, the Data API, allows you to perform and use the youtube video search capabilities, use playlist capabilities and many more of the operations available on the YouTube website.
That have being said, the Youtube API, can be used for example to upload a video from your iPhone to youtube, as this example illustrates.
My Thoughts:
I think that extracting the audio from a youtube video, is actually possible, but involves a whole different process of downloading the video in H264 and then extracting the audio... but it still involves downloading the whole video.
Is the audio only prohibition still valid? Streamus is available as a Chrome Extension. It streams audio only from YT - see website https://streamus.com/
Well, one can simply give the video a width and height of 1px, or better yet do:
.video { text-indent: -9999px; }
And then force the video to play via the API controls. But I wouldn't do it as it is against their TOS and would result in my app being blocked if they find out.
I really confused about your platform. Do you want to do it over iOS platform with writing native code? If yes, you can do it without playing video. But you have to stream both video and music. You can do it with AVAudioPlayer Class, check the reference from
https://developer.apple.com/library/ios/documentation/AVFoundation/Reference/AVAudioPlayerClassReference/
But yes, you will makes users GSM data overload and it's not fair with letting users about that situation.
Maybe you can force your view over the youtube view? Have you tried that?
If it is against TOS, the op should just drop the idea of implementing his idea.
Just imagine the free music everyone will be streaming out of the promo videos of major videos on youtube!