How to tell YouTube that a livestream is a 360 video? - youtube-livestreaming-api

We are successfully streaming video to YouTube already. However we don't know how to create the livestreams for a 360 video via the API:
My guess is that we miss some documentation about how to tell YouTube that a video stream needs to be played back in a 360 video player. We are using this code snippet to generate the liveStreams resource:
NSDictionary *stream = #{#"snippet": #{#"title": broadcast.title ? broadcast.title : #"mimoLive Livestream"},
#"cdn": #{#"resolution": resolution,
#"frameRate": framerate,
#"ingestionType": #"rtmp"}};
Is there a (un)documented key we need to add here?
Refering to YouTube API:
https://developers.google.com/youtube/v3/live/docs/liveStreams
(BTW: Facebook recently added the option is_spherical to their API to make this work)

You need to set the contentDetails.Projection field to 360 when creating a new broadcast object. It is set to rectangular by default. This is documented under https://developers.google.com/youtube/v3/live/docs/liveBroadcasts

Related

How to get playing radio station url using sonos API

We are using Sonos API for controlling Sonos. We need to play a radio station on a speaker.we are using playbackMetadata API for getting the information about the radio station and we get a response as below
{
"container" : {
"type" : "station",
"service" : {
"id" : "254",
"name" : "TuneIn"
},
"name" : "Radio Bern1",
"id" : {
"accountId" : "sn_0",
"objectId" : "s15452",
"serviceId" : "254"
}
}
}
we need to play this radio station again after a doorbell is played in the same speaker. for that, we need the URL of the radio station to play using loadAudioClip API in Sonos document. Is there any other API that we can use?
Am I correct in understanding that you are trying to resume the existing music on a device after a doorbell sound is played?
If so, then the best way to accomplish this is to use the loadAudioClip API for the doorbell sound: https://developer.sonos.com/reference/control-api/audioclip/loadaudioclip/
A solution using the loadAudioClip API would work like this:
An audio stream is playing on a Sonos speaker (in your example, a TuneIn radio station)
A doorbell press triggers a loadAudioClip API call, which plays a doorbell sound (from a provided stream URL) on the Sonos speaker
When the audio clip is finished playing, the original stream (a TuneIn station in this example) will automatically resume playing.
In summary, you want to use loadAudioClip for the doorbell sound, and it will automatically resume any music stream that was already playing.
Please let me know if this doesn't solve your problem.
Thanks!
-Mark
There is no way to get a direct stream link to a playlist item. You have two options to solve this issue using the loadAudioClip API: https://developer.sonos.com/reference/control-api/audioclip/loadaudioclip/
Option 1 - utilize the default CHIME sound that is available as part of the loadAudioClip API. After the CHIME plays, any music that was playing before will resume. Using this default sound is documented in the link provided above.
Option 2 - if you want to play a specific, custom sound clip, you will need to provide your own streamUrl to this sound clip. An example of this is also provided in the documentation link above.
I would suggest starting with Option 1 above to get your application working with the default CHIME clip. If you have a need to use a custom sound, move on to option 2 once you have your custom audio clip available via a streamUrl.
Hope that helps!
Thanks,
Mark
I'm not sure it the cloud api also supports actual urls, but in my sonos library we are generating the TuneIn url with only the information you've provided.
x-sonosapi-stream:{container.id.objectId}?sid={contianer.id.serviceId}&flags=8224&sn=0
or with your data:
x-sonosapi-stream:s15452?sid=254&flags=8224&sn=0

Android app displaying list of video from YouTube playlist using YouTube API

I want to make an app which shows video from my YouTube channel or from my playlist using using YouTube API..
the app should be like this..
app should display list of all video in playlist and when user click on any video it should be played...
how can i do this app ?
if you know solution please send both java and xml code for this.. or send a link from where i can download source code
Checkout PlaylistItems, it returns all the videos from your playlist.
"A playlistItem resource identifies another resource, such as a video,
that is included in a playlist. In addition, the playlistItem resource
contains details about the included resource that pertain specifically
to how that resource is used in that playlist."
For Java code samples, checkout the Official Youtube api-samples/java for code reference.

YouTube Data API video insert/update - setting 'Game title'

The YouTube Data API v3 functions Video.insert and Video.update do not contain an option to set the "Game title" as you can when uploading / updating a video in the web UI:
This is only available if the category is set to Gaming.
Edit: To clarify, I do not wish to set the Video Title. This input is used to identify the Game that is being played in the uploaded video and is displayed under the video description.
Is there an API endpoint to set this Game title? Or do I have to POST to https://www.youtube.com/metadata_ajax?action_edit_video=1 like the web UI does?
The Youtube Data API does not have this implemented at this time of writing. And nether we are able to Get the game title as well.

Playing youtube/vevo videos on iOS

I've seen the Google blog article explaining the way to embed youtube videos in an iOS app. I've successfully embed videos in my iOS app. BUT, I've seen the WhoSampled app where they are able to play Vevo/youtube videos. Somehow they are able to play those videos and my app is not able to play them. (In my app, there is a blue play circle with a line through it showing that is not playable.)
How do I allow those videos to be playable?
Do I have to setup the youtube link in a specific way or is there a way I need to setup the developer key?
There is a way to get the actual video stream for a given YouTube video instead of the HTML-embedded one. See this project:
https://github.com/hellozimi/HCYoutubeParser
The problem with this approach is that it will likely violate the EULA of YouTube APIs, especially if you are releasing it in a paid application:
In addition, please remember that attempting to play a YouTube video outside of either the YouTube embedded, custom or chromeless player is strictly prohibited by the API Terms of Service.
(source: https://developers.google.com/youtube/creating_monetizable_applications)
You just have to use the iframe embed as opposed to the Flash one.

Play brightcove videos

I want to play a remote video hosted in Brightcove. As Brightcove URLs are links to players not direct links to video files the AVPlayer won't do it.
I know Brightcove provides an API but can't find any good examples for iOS nor documentation.
Any help/pointing direction appreciated.
I haven't used Brightcove, but poking around their site, I see they have two APIs: a Player API and a Media API. It sounds like the Media API is what you want — it's documented as giving direct references to the videos. The page has a link to several examples.
You can also lift alot of the code from their Oneplanet demo source. In fact the whole playlist and video player mechanism can be practically copied into your project so all you need to do is pass a video or playlist ID into their initwithnibandplaylist function in their view controller and you're good to go.
I hope this helps your question. There is a renditions which contain direct video link.
Here is a link for api link.
http://support.brightcove.com/en/video-cloud/docs/accessing-video-content-media-api
renditions is a javascript object containing multiple video links based on resolutions such as 360,460, 720.
You can find the direct link to the video via the media api, bypassing the player API entirely. You need a pro account and a token:
http://support.brightcove.com/en/docs/getting-started-media-api
Alternatively, you can create a simple "player" without any controls (just a video window actually) and make your own HTML controls totally outside of Brightcove to trigger almost anything you'd want to do via the player API.
There is also a Brightcove iOS SDK. It is really two SDKs one for the Media API and one that includes a MediaPlayer. If you want to use the AVPlayer you can use the Media API iOS SDK. Here is the docs for that:
http://docs.brightcove.com/en/video-cloud/mobile-sdks/brightcove-player-sdk-for-ios