Facebook Graph API and Live Streaming using a Persistent Streaming Key - facebook

I have integrated an existing streaming application with Facebook, but am facing a final hurdle. My software doesn't have an API to change the streaming key. So I use a Persistent Key for Youtube, and also for Facebook.
However, I want to automate the whole system and I cannot find how to use the Persistent Streaming Key (PSK) with Facebook icm the Graph API.
I schedule an event, but when I start streaming to the PSK the connection is rejected. It does work however if I go to the Facebook Page and open the Live Producer for the scheduled stream. Straight away the stream is accepted and seems to be connected to the stream originally assigned to the LiveVideo (or at least that is how is seems).
Is there a way to allow the PSK to be accepted without the manual intervention of opening the Live Producer page? I don't seem to be able to find anything.

Is there a way to allow the PSK to be accepted without the manual intervention of opening the Live Producer page?
Unfortunately, no.
Your automation really needs to tie into the rest of the Facebook Live API so that you can create/start streams. It isn't possible to use RTMP alone, even with the persistent stream key.

Recently, usage of PERSISTENT STREAMING KEYS has been enabled by Facebook. Here is the detail: https://www.facebook.com/formedia/blog/new-live-tools-for-publishers-persistent-stream-keys-crossposting-and-live-rewind
There is no documentation anywhere, but it looks the LiveVideo object's stream key can be updated to PERSISTENT STREAMING KEY via POST endpoint on LiveVideo object
checkout this link on Facebook developer - the return value of LiveVideo object has PERSISTENT STREAMING KEY -
https://developers.facebook.com/docs/graph-api/reference/live-video#Updating

Related

Need clarity on Vidyo Io possibilities

I am just exploring on Vidyo IO platform for enabling video conferencing capabilities on top of one web application. I am just concerned about the below points and trying to get answers for the same.
Can anyone please help me with the details for the below points if you are aware of them?
Can we add/remove the participants from the video conference.
Can we just have an audio call.
Are the conference calls carried in the encrypted mode.
Are there any chances like generated API token can be stolen by any hackers and join into the conference call.
Thanks
Can we add/remove the participants from the video conference.
Yes. This kind of "moderation" may be achieved via client SDK only as well as via Vidyo backend APIs.
Can we just have an audio call.
Yes. On your application level you should just not select any local camera device (in Visyo SDK language - .SelectLocalCamera(null)).
Are the conference calls carried in the encrypted mode.
Yes.
Are there any chances like generated API token can be stolen by any hackers and join into the conference call.
Token is being generated based on ApplicationID and DeveloperKey that are tied to your personal account. If you don't expose this information, Token will not be compromised.

AMSv3 Multiple track files as inputs to an Asset

Goal: Use a single streaming locator to several tracks of mp3s where the client can get one token with the streaming locator's claim and play each track during its lifetime.
I modified my output asset job process to use the List<string> files, but the job fails saying the input asset does not have a primary file.
Is my approach wrong, or is there a way to say track1.mp3 is the primary?
I am trying to configure a situation like this:
1 stream locator (1 claim required for access)
several tracks in that locator (1.mp3, 2.mp3, ... 50.mp3)
customer buys 1 sku, gets that stream locator's claim
This would be my expected approach. However, my fallback (and fear) is that AMS wants me to have a 1:1 with 1.mp3:streamlocator.contentkey.id and maintain that list in a backend, then use this sequence flow:
Client requests token from a lookup endpoint
Endpoint compares their ownership vs the requested 1.mp3
If they have access to the sku 1.mp3 belongs to in the backend, issue signed token with the the content key id associated from 1.mp3:streamlocator.contentkey.id
If they dont have access, 401 the token request back the client app to handle
Let's take a step back and modify the scenario a bit: suppose it is a (single bitrate or multi-bitrate) video with 3 audio streams. And you want a 1:1 mapping for streaming_locator : content_key_id : media_asset. With a token containing the right claims you can get the decryption key/license and play any of the 3 audio streams (with video) with a video player. This scenario is supported by AMS and I don't see any problem with this.
However, your scenario is MP3 (without video). My concern is whether there is a binding between MP3 and AES-128 encryption or any DRM, and using such binding in AMS dynamic packaging. Without such encryption, how do you enforce the protection or what is the purpose of token?

How to get Facebook Persistent Stream Key?

Is there any way to obtain Persistent Stream Key trough graph api? I do see option 'Use a persistent stream key' on the configure stream page. But there is no parameter to set it by API. I'd like publish the stream when it's stopped but keep the same key for streaming. Looks like I have to create a new key every time but it's quite inconvenient.

Google Assistant actions on google

All my hardware is already developed. I use MQTT for communication between my devices, I have lights, fans, heaters and many more ioT appliances. I can controll all of these from my Android application which i have built. I would like to use Google Assistant to control my devices as well. The status of my lights (on/off) are stored in a sql database and when ever a change occurs to the database(detected by the hardware) my hardware can control that specific light. In My Android app i do the same thing which is updating the databases value(on/off) of the light and the change is detected by my hardware platform. Can i use Google Assistant to update a sql database value?
I can create a webserver( ASP.NET C#) and pass the command to the sql database of my relevant customer if google assistant can invoke the username or email, lightID, command to my webserver. Can google assistant do this? If not how would achieve this.
It sounds like you want to take a look at the Actions on Google Smart Home API which will let the Assistants Smart Home controls work with your control server directly.
Without knowing exactly how your database or existing web server are configured or hosted, I can speak only broadly at best. Your web server will need to implement two primary things:
You'll need an OAuth2 server that can issue tokens that represent your users. This is how Google will associate the user's account on the Assistant with your account, and how Google will identify (to you) which user is issuing the command.
You will need to implement a webhook at a URL on your web server. This webhook will be sent a POST message containing a header with a valid auth token (that you issued) and a JSON body. The JSON will contain information about the command that has been issued by the user. Your HTTP reply body will also be JSON. For details of the JSON formats and all the fields that it can send and that you must reply with, consult Google's documentation.
There are a number of different commands (which Google calls "intents") that Google can send you on behalf of the user. You should be able to handle all of them by either querying or modifying your database:
SYNC - A request for what devices this user has, some of their configuration information, and what commands they respect.
QUERY - What is the current state of the devices for this user.
EXECUTE - Change the state on some of the user's devices.
RESYNC - (Future update) A re-request of the user's device info.

Offsite data storage for simple app, or a similar supported persistence mechanism?

Question
Is there a usable facebook entry point to the Data Storage API that facebook lists on their app admin page for developers, or should I consider an alternate mechanism? What alternative mechanisms exist to simply persist my information offsite (away from my server app) without stuffing it into a cookie that's prone to expire?
...
Background
The facebook Data Store Admin tool is made available in a facebook App's Settings as seen here: (continue reading below)
However when I visit the DataStoreAdmin link nothing works (i.e. clicking the buttons to define the data store types and objects does nothing - I have tried different browsers).
The Wiki page for Data Store API hasn't been updated recently and the second last update says the beta Data Store was taken offline.
It seems odd the link would be readily available and highly visible at the top of the App configuration area if indeed it's defunct. I was hoping some kind of key/value pair solution to remove the data calls from my own server.
DataStore API is being deprecated, don't use it! You can see this here. You are advised to store the data yourself on your server.