Check if there are any SoundCloud players playing - api

I need to find out if it is possible to check if there are any sound cloud players playing (or if there are none playing) on a page at any given point.
The sound cloud api seems to allow you to check if a player is paused but i'm not sure if this apply's to all players on a page or not?
Any thoughts or pointers would be much appreciated.

Not an expert on this but looking at the embedded widget page, they are using an iFrame, meaning it's running in an isolated environment. Unless they go out of their way to provide this feature (using cross-document messaging for example), it won't be possible.
(Well, if you want to go for a really weird hack, you could request the user's microphone permissions and detect the audio playing :)

You could just make a separate SC.widget object for each player on the page. You could create a script to find them if all the iframes on the page are soundcloud players like this:
var widgets=new Array();
$('iframe').each(function (index, iframe) {
widgets.push(SC.Widget(iframe));
});
Then you could check if all of them are paused.

Related

I don't want camera permission needed for each video chat when there is a series of 1-1 video chats at an event

I am not a coder and having a web platform built with PHP that includes a series of 1-1 video chats in a scheduled networking "event". The problem that the developer is not able to solve with the video plug in that they are using (https://www.magnoliyan.com/video-chat-pro/) is that the user needs to give camera permisson before each chat. I need this permisson to happen one time only at the beginning of the event and not need there to be any further permission giving throughout the event. Of course I would like this to work on all platforms. I'm exploring agora.io as an option to solve this and replace the current plug in with agora. Does anyone know if agora would be the right fit for this or which video chat platform I should use to accomplish this? And if there is specific developer kind of language or code - please speak in as if I was a developer and I will pass on what you say to him directly. You don't need to worry about whether I will understand it.
Thanks!
Jon
Agora.io like any other WebRTC provider requests device camera permission only once. And all subsequent Videocall won't need any special permission (provided that they are on the same domain)
More specifically, Agora.io requests browser permission when stream.init method is invoked. This also turns on the camera light. stream.close turns off the camera light and deallocates the resources.
However, the subsequent stream.init function calls do not require permissions. (Camera light will just turn on)
References:
stream.init: https://docs.agora.io/en/Video/API%20Reference/web/interfaces/agorartc.stream.html#init
stream.close: https://docs.agora.io/en/Video/API%20Reference/web/interfaces/agorartc.stream.html#close

Twillio Programmable Video

Is it possible with the Programmable Video API from Twilio to build something that resembles the Google Hangouts functionality in terms of how it focuses on the person talking automatically?
I don't see any examples or notes about this in their documentation and the github for this doesn't seem to be frequented that much.
Would appreciate any help, thank you!
Twilio developer evangelist here.
You can build that sort of thing, however it is currently out of scope for the Video SDK itself.
I haven't done this before, but I'd start by looking into analysing the audio coming from each participant in the chat. You can actually create audio sources from an existing <video> or <audio> element. In the case of Twilio Video, each track is created as a separate element, so you want to look for <audio> elements and use them:
var audioElements = document.querySelectorAll('audio');
audioElements.forEach(audio => {
var audioCtx = new AudioContext();
var source = audioCtx.createMediaElementSource(audio);
// create audio analyser, analyse volume in audio
})
You want to use the Web Audio API to then analyse all the remote tracks and work out which is currently making the most noise for a sustained period of time and switch to that one. This blog post may help with the analysis. I've not seen anything that will help with the selection, but hopefully you can work it out from there.
Let me know if this helps at all.

Create a custom desktop YouTube player

I want to create an application capable to play YouTube video's audios and also save the downloaded content in a local cache, therefore when the user decides to resume or play the video again, then it doesn't have to download part of video again but only download the remaining part (User can decide what to do with the cache then, and how to organize it).
It is also very convenient for mobiles (it is my main focus) but I'd like to create a desktop one too for experimental purposes.
So, my question itself is, does YouTube provide any API for this? I mean, in order to cache the download content I need that my application download the content and not any embed player (also remember that it is a native application). I have a third-party application in my Android system that plays YouTube videos, so I think it's possible unless that the developers use some sort of hack, again this is what I don't know.
Don't confuse with the web gdata info API and the embed API, this is not what I want, what I want is to handle the video transfer.
As far as I know, there is no official API for that. However, you could use libquvi to look up the URLs of the real video data, or you could have a look at how they do it and reimplement it yourself (see here).

Streaming movies from my server

I'm playing around to make an app that lets people stream cartoons that I make. It's a very simple app, one ImageView is just loading in a html-homepage in a UIWebView. Witch contain links to .mov files. So if you tap them a movie will start playing. This is because I just want to update the html-file with new cartoons every week.
Is this an "ok" way to do things code:ing-wise? Or am i obligated to us some Objective-c streaming functions?
Is there a specific file-type that i have to use in the movie-files on the server?
Is the HTML static in your app, or does it point to a server? If it's the former, you may be able to get the app approved doing it the way you suggested, depending on the reviewer. If it's the latter, you're unlikely to get it approved by apple.
They tend to frown upon web sites bundled into apps, and will tell you to simply make your website usable with the phone. See section 2.12.
My suggestion is to spend a bit more time and offer iOS users a better - and more immersive - experience than is available via the web. As I'm sure you've found, there are many built-in ways to stream movies and to present them in a manner that surpasses a web-page-like experience.

Private viewers using the YouTube API

Has anyone been able to set who can view a private video on YouTube using the API?
The API isn't designed for this, so it's either very difficult or impossible.
You can only share a private video with 25 of your friends, so you have to first be friends with them, then give them access, which means the api would have to do all of these actions and once you hit 25 people you'd have to stop anyway.
You should probably use a different service or make your own if you want private videos.
Well you could try to load the FLV to your own website. Do a login system and use flowplayer to show it.
I've worked with the YouTube API which is pretty nice and works very smooth with jQuery and Ajax - but as the others have already mentioned there is no built-in feature for that.
You could probably find some sort of work-around as you could integrate you own authentication and login capabilites - but obviously that would not prevent your users not being able to watch the "restricted" video.