Is there any way to detect if the live stream is started successfully in JITSI meet external API? - live-streaming

I am using the jitsi meet external API to make video conference.
I use the following API command to start live streaming:
api.executeCommand('startRecording', { mode: 'stream', youtubeStreamKey: streamName })
But is always returns undefined, is there any way to identify if the streaming is started successfully or not.

Related

Twitter API : Error: Request failed with code 403 (image upload)

There are a few things I don't understand about the Twitter API.
I am using the following package: https://www.npmjs.com/package/twitter-api-v2
Which allows me to connect to a twitter account.
I recover all the credentials of the connected account.
(Among other things, I manage to recover user data and send simple tweets)
I am trying to upload an image.
So I have the following code:
const result = await client.v1.post(
"media/upload.json",
{
command: "INIT",
media: file,
},
{
prefix: "https://upload.twitter.com/1.1/",
}
);
And I got the following error returned to me:
Error: Request failed with code 403 - You currently have Essential access which includes access to Twitter API v2 endpoints only. If you need access to this endpoint, you'll need to apply for Elevated access via the Developer Portal. You can learn more here: https://developer.twitter.com/en/docs/twitter-api/getting-started/about-twitter-api#v2-access-leve (Twitter code 453)
I have read and write permissions.
(since I manage to send tweets)
I understand that the V2 api of twitter does not allow image upload, but here I am using V1?
Can you give some information ?

Trying to get Vimeo API to recognize the upload file

I am using Expo managed Workflow with react-native and trying desperately to not have to eject. The only sticking point in the entire app is allowing users of the app to upload video into a usable format. I am hoping to use Vimeo as the video hosting service.
I am authenticated and verified and interacting with the Vimeo API.
On my express server when I run this code:
let Vimeo = require('vimeo').Vimeo;
let client = new Vimeo({vimeo creds});
client.request({
method: 'GET',
path: '/tutorial'
}, function (error, body, status_code, headers) {
if (error) {
console.log(error);
}
console.log(body);
})
I see this message:
message: 'Success! You just interacted with the Vimeo API. Your dev environment is configured correctly, and the client ID, client secret, and access token that you provided are all working fine.',
next_steps_link: 'https://developer.vimeo.com/api/guides/videos/upload',
token_is_authenticated: true
I successfully uploaded a video from my express server using this code and placing the file on the same directory as the server code.
client.upload(
"{filename}",
{
'name': ' Test Video 1',
'description': 'The description goes here.'
},
function (uri) {
console.log('Your video URI is: ' + uri);
},
function (bytes_uploaded, bytes_total) {
var percentage = (bytes_uploaded / bytes_total * 100).toFixed(2)
console.log(bytes_uploaded, bytes_total, percentage + '%')
},
function (error) {
console.log('Failed because: ' + error)
}
)
Then, I added the same functionality to my web app locally for testing but not on an express server, trying to do it within a react native app running in a browser (for starters). I still get the message that says I am successfully interacting with Vimeo API and that I am authenticated.
However, When I try to add the file in the react native app with the exact same code, except this is how I am accessing the video file from react native: filename = require({pathToFile});
and the failed response says:
"Failed because: Unable to locate file to upload."
I do not know if the message is incorrect and if Vimeo API is having issues understanding the file or if it could be that because I am no longer running on a server.
So I keep trying to make sense of how to do this but wonder if I am missing something at this stage of testing.
Because...
I am able to upload the video to Firebase Storage by using expo-image-picker.
When I try to give the Vimeo API the file from what I have retrieved from the filesystem, it still says it is unable to locate file to upload.
In this case the string I am trying to upload looks like this: data:video/quicktime;base64,AAAAHGZ0eXBtcDQyAAAAAW…5AQLMKwEjd8ABNvCVAUgYoQFR1yYBVZYxAVX9NwFXEy8BYh0m
Any suggestions of a way to get Vimeo api to recognize this file?
I really want to use Vimeo for this project I can't find anything on stack overflow related to this except this one question which noone has attempted to answer:
Failed because: Unable to locate file to upload but path is correct (Vimeo API)

Unable to start live streaming in agora with vp8 codec

I want to create a live stream with multiple broadcasters/hosts and publish it to RTMP CDN with agora.
I am using agora-rtc-sdk-ng library.
As per documentation I have tried to start live streaming but it is giving the below error while calling
AgoraRTCClient.startLiveStreaming
Error :
{
"name": "AgoraRTCException",
"code": "LIVE_STREAMING_INVALID_RAW_STREAM",
"message": "AgoraRTCError LIVE_STREAMING_INVALID_RAW_STREAM: raw streaming is only support h264"
}
Can anybody help me how to solve this error?
While calling createClient to create a local client object. Pay attention to the settings of the mode and codec parameters when creating the client: just pass the codec to "h264" here is the sample.
rtc.client = AgoraRTC.createClient({ mode: "rtc", codec: "h264" });
For detailed explanation please visit the agora documentation link here
https://agoraio-community.github.io/AgoraWebSDK-NG/docs/en/basic_call#2join-a-channel

Agora Cloud Recording [ Web Page Recording ] : Error 404 (no Route matched with those values)

I trying to use new mode recording from Agora Here.
But It doesn't work for me. I always got Error 404 with message ('no Route matched with those values')
Here is my url path
'/v1/apps/{appid}/cloud_recording/resourceid/{my-resource-id}/mode/web/start'
I already check on Cloud Recording RESTful API to find pattern for request body but It doesn't said anything about Web Page Recording. (Maybe because It's just beta for now)
Here is my start request body that I copy from tutorial but It doesn't matched with RESTful API
const extensionServiceConfig = {
errorHandlePolicy: "error_abort",
extensionServices: [{
serviceName: "web_recorder_service",
errorHandlePolicy: "error_abort",
serviceParam: {
url: "myurl",
audioProfile: 0,
videoWidth: 1280,
videoHeight: 720,
maxRecordingHour: 2
}
}]
};
The "404 No Routes" error is caused by Cloud Recording not being enabled on your project. To enable cloud recording on your project, you’ll need to click into the Products & Usage section of the Agora.io Dashboard and select the project name from the drop-down in the upper left-hand corner, click the Duration link below Cloud Recording.
Here is a step by step guide I wrote: https://medium.com/agora-io/agora-cloud-recording-quickstart-guide-with-postman-demo-c4a6b824e708
Also Agora offers a Postman Collection that provides a sample body for making a request and if viewed through the Postman app it will generate the JavaScript snippet for you.

How to connect backend service with philips hue bridge remotely?

I'm looking to write a philips hue service that needs to allow users to register their hue bridge with my service. This service would change the color of bulbs based on an event. I'm aware that I can use IFTTT but in this scenario, I'd like to not use IFTTT and I'd like to register my website with philips hue's apps.
Any idea how I can do this? Your help is very much appreciated. Thanks!
EDIT: Not sure why I was down voted but I definitely did do my research. I looked on philips hue's developer website and couldn't find anything that was explicit on their APIs. I also looked through the iOS SDK and didn't see any methods that would trigger the pairing routine for remote devices. So far, the only example I have of this working (outside of Philips' products is the IFTTT service, which allows for an entry to be added into the 'My Apps' section).
TLDR: I wrote an API: https://github.com/jarvisinc/PhilipsHueRemoteAPI
I answered this question on my technical blog (http://blog.paulshi.me/technical/2013/11/27/Philips-Hue-Remote-API-Explained.html), which I will post here:
The question actually comes as two part:
Authentication
Remote Control
Authentication
I haven't figure out a reliable way to do authentication automatically. The following procedures needs to be automated: The idea is to fake as official iOS APP which has the ability to control remotely when enabled. We will need to get BRIDGEID and ACCESSTOKEN to pass the authentication step for remote control.
Find your BRIDGEID from https://www.meethue.com/api/nupnp. (or in My bridge page on the meethue website and by clicking on "Show me more")
Get ACCESSTOKEN
www.meethue.com/en-US/api/gettoken?devicename=iPhone+5&appid=hueapp&deviceid=**BRIDGEID**
Right click on "BACK TO THE APP" and write down ACCESSTOKEN inside the link it redirect to
phhueapp://sdk/login/**ACCESSTOKEN**
Basically it is a hack to get your access token. You fake your app as the official iOS Hue App, and ask for access token that way. I am not sure there is an easier way out there, if you do know one, please do comment below.
You can potentially automate it by doing simulated log-in session and grab the the ACCESSTOKEN by scraping the page content. But I consider it highly unreliable because any change to the official page will likely break it.
I wrote this script that allows the automation of getting ACCESSTOKEN as of today, but I don't guarantee it will work tomorrow for the reason I explained above :P
Currently, this OAUTH process only works with official apps. There might be a slight chance that they will open it to other 3rd party apps.
Remote Control
Once authentication is done, this part can be done automatically. There are 2 known private endpoints for sending control command and getting all the status related to the hue bridge.
Sending Command Endpoint:
POST https://www.meethue.com/api/sendmessage
Getting Status Endpoint:
GET https://www.meethue.com/api/getbridge
Sending Command Endpoint
URL: https://www.meethue.com/api/sendmessage
Method: POST
URL Parameters:
token=**ACCESSTOKEN** (which you obtained earlier)
Request header
content-type=application/x-www-form-urlencoded
body
clipmessage={ bridgeId: "**BRIDGEID**", clipCommand: { url: "/api/0/**APIENDPOINT**", method: "**METHOD**", body: **JSONCOMMAND** } }
BRIDGEID is the same one you obtained earlier
APIENDPOINT the same as official API /api/<username>/*** by removing /api/<usename>/ part
METHOD PUT/GET/POST/DELETE the same 4 method as official API. Despite GET really doesn't work since all response from the Sending Command Endpoint is 200 explained in the following part, while DELETE is not tested
JSONCOMMAND The actual command body for example {"on":true}
Getting Status Endpoint
URL: https://www.meethue.com/api/getbridge
Method: GET
URL Parameters:
token=**ACCESSTOKEN**
bridgeid=**BRIDGEID**
Request header
content-type=application/x-www-form-urlencoded
Limitations
Current limitation is you cannot immediately know from the response whether your control command succeeded like the official API. All the response you get from calling the Sending Command Endpoint is pretty much always <200> if you are doing it correctly. But you can always pull all the status related to the Hue bridge from the Getting Status Endpoint.
Remote Control API
I wrote Philips HUE Remote API to specifically solve the remote control problem.
Enjoy :)
Paper
For full documentation please refer to this excellent paper:
Hacking Lightbulbs: Security Evaluation of the Philips Hue Personal Wireless Lighting System by Nitesh Dhanjani
I did some investigation by following the steps of #paul-jianer-shi however the access token are not shown in the generated HTML.
I think the Hue Portal has been updated and removed the way it potentially shows the access token.
I wrote a blog post about doing Remote Hue operations by reusing the access token of another application, like IFTTT. The main change is how to get your hands on that access token. The token in shown in the 'My Apps' section of the Hue Portal. Check the (De-activate) link. It contains the access token.
Next step will be to let Hue Portal trust my own app.
Philips plan to make the remote API available to 3rd parties(it's already used by IFTTT and meethue.com).
There is currently a form on the developer website to request an early access(must login):
http://www.developers.meethue.com/content/remote-api