Soundcloud Live Comment Stream - api

I am working on an app and would like to display all the comments for a given Soundcloud track in real time. We have created a custom html5 audio player and it is not the format of the standard embedabble soundcloud player. The comments should show up in a given space and follow the progress of the song. It would display the comment with a timestamp of "5 seconds" when the song has played for 5 seconds, etc.
Currently we have only found that you must make a separate API call for each new comment.

The custom player from SoundCloud doesn't support this at the moment.
But if you're building a player using the SC.stream function of the SoundCloud JS SDK you can use the ontimedcomments options:
SC.stream("/tracks", {
autoPlay: true,
ontimedcomments: function(comments){
console.log("First Comment at this timestamp", comments[0].body);
}
});
The only downside with this is that you have to build the player UI yourself.
There are some more examples in this post: http://developers.soundcloud.com/blog/rich-media-using-timed-comments

Related

How to publish LocalScreenShare tracks from IOS to Web browser in React-Native using Twilio

I want to integrate Screen Share feature in my react-native application in which I am using Twilio for video communication. In Web we are able to achieve this by following these steps.
1 : We get the media device stream using
navigator.mediaDevices.getDisplayMedia({
video: true,
});
2 : Then we get the first stream tracks using
const newScreenTrack = first(stream.getVideoTracks());
3 : After that we set this newScreenTrack in some useState
const localScreenTrack = new TwilioVideo.LocalVideoTrack(
newScreenTrack
);
4 : After that we first unpublish the previous tracks and publish the new tracks using
videoRoom.localParticipant.publishTrack(newScreenTrack, {
name: "screen_share",
});
5 : And finally we pass these tracks in our ScreenShare component and render these tracks to View the screenShare from remote Participant.
I need to do the same thing in my react-native application as well. Where if localParticipant ask for screenShare permission to another participant. Participant will accept the permission and able to publish the localScreenShare tracks.
If anyone know this please help me in this. It would be really helpful. Thank you
I think this is an issue with the react-native-twilio-video-webrtc package. It seems that, as you discovered in this issue, that screen sharing was previously a feature of the library and it was removed as part of a refactor.
Sadly, the library does more work than the underlying Twilio libraries to look after the video and audio tracks. The Twilio library is built to be able to publish more than one track at a time, however this React Native library allows you to publish a single audio track and a single video track using the camera at a time.
In order to add screen sharing, you can either support pull requests like this one or refactor the library to separate getting access to the camera from publishing a video track, so that you can publish multiple video tracks at a time, including screen tracks.

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

how to post video on fb timeline using share dialog with javascript sdk?

I have developed one application. I have to upload video on fb timeline, from developed application trough Facebook JavaScript sdk with help of FB.ui method.
i have shared part of my code, which i tried to post video on facebook timeline.when i used this code, video get upload as a link. it will navigate to new tab and play when i click on that link.(my video type is mp4.)
FB.ui({
method: 'feed',
display: 'popup',
type:'mp4',
source:filePath,
picture:filePath,
},function (response) {
if (response && !response.error_message) {
alert('Posting completed.');
} else {
alert('Error while posting.');
}
I expect the video to be play on my timeline instead of posting as a link.
I expect the video to be play on my timeline instead of posting as a link.
That expectation is simply unfounded – this isn’t supposed to work this way, and never has.
You would need to share a link to an HTML document, that has the video embedded via Open Graph meta tags, see https://developers.facebook.com/docs/sharing/webmasters#video
But Facebook has begun limiting the occasions on which they actually play such videos inline; so even if you implement this properly and technically correct, there is no guarantee any more it will play in news feed; users clicking on such a post might simply get redirected to your external site to play the video there.

"Start a Hangout on Air" button for Youtube LiveStreaming API

We've been using the as yet un-deprecated "Start a Hangout on Air" button:
https://developers.google.com/+/hangouts/button
to start hangouts on air on our site http://agileventures.org for several years now. Full source code at http://github.com/AgileVentures/WebsiteOne
In the last 24 hours, clicking those buttons now redirects to instructions to manually start a youtube live event:
https://support.google.com/youtube/answer/7083786?visit_id=1-636118907663120157-3101666316&p=live_hoa&hl=en&rd=1
This is a problem as manually started events will not create the hangout app that lets our community know an event is starting and provides us with important telemetry on events.
There is unfortunately no documentation in the youtube live streaming API about how to create a button that will create a youtube live streaming event, or load a plugin into that event:
https://developers.google.com/youtube/v3/live/docs/
We need some code similar to that provided by the hangouts api, e.g.
<script src="https://apis.google.com/js/platform.js" async defer>
</script>
<div class="g-hangout" data-render="createhangout"
data-initial_apps="[{ app_id : '123456789012', start_data : 'dQw4w9WgXcQ', 'app_type' : 'ROOM_APP' }]">
</div>
but that will work with the new youtube streaming api. Any ideas?
The YouTube live documentation talks about being able to create a broadcast, but it seems to be only for custom "streaming" broadcasts and not hangouts:
https://developers.google.com/youtube/v3/live/docs/liveBroadcasts/insert
The new events page allows us to select the "quick" type, which creates a hangout on air (https://www.youtube.com/my_live_events?action_create_live_event=1) so we can create HOAs manually, but not programmatically? We would very much appreciate clarity from Google on this.
It seems that support for Hangout on Air Buttons, creation of HOAs via API has been dropped no?
Note that Google is specifically requesting support questions for the Youtube LiveStream API are posted to StackOverflow:
https://developers.google.com/youtube/v3/live/support
The functionality all started working again after a 3 week break. We're not sure if Google changed anything. There were no changes on our end. Buttons for starting HOA's have been stable now for the last two months or so ...

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.