How to integrate Google Home CameraStream with AWS kinesis video streaming? - node.js

We have a home camera device which is using aws kinesis video streaming for webrtc.
We were trying to integrate google home to enable command based live straminga and using https://developers.google.com/assistant/smarthome/traits/camerastream to do set up part, as per this link we need following info to proceed streaming:
{
"cameraStreamIceServers": "[{"urls": "stun:stun.l.partner.com:19302"},
{"urls":"turn:192.158.29.39:3478?transport=udp","credential": "JZEOEt2V3Qb0y27GRntt2u2PAYA=","username": "XXXXXXX"},{"urls": "turn:XXX.XXX.29.39:3478?transport=tcp","credential": "XXXXXXXXXXX=","username": "XXXXXXXXXXXXXXXXX"}]",
"cameraStreamSignalingUrl": "https://example.com/signaling/answer",
"cameraStreamOffer": "o=- 4611731400430051336 2 IN IP4 127.0.0.1...",
"cameraStreamProtocol": "webrtc"
}
cameraStreamSignalingUrl - URL endpoint for retrieving and exchanging camera and client session description protocols (SDPs). The client should return the signaling URL which uses the cameraStreamAuthToken as the authentication token in the request header.
cameraStreamOffer - Offer session description protocol (SDP).
We also checked kinesis document but haven't got any clue to get this information as we are beginner of this thing any help would be recommendable.

Related

How to use RTSP live stream's link from tuya API?

I've got a link from Tuya API explorer using the service "IoT Video Live Stream". I want to know where I can use this link for stream my camera's video. I have the video on my tuya APP, but I want use this link.
Here's an example of the API return.
{"result": {
"url": "rtsps://eb3ba0.....aa418b.....:4UBYKMX9T.....T0#aws-tractor1.tuyaus.com:443/v1/proxy/echo_show/b6721582601.....b46ac1b71.....bbb3d*****bf7.....},"success": true,"t": 1642462403630}

Google Action - playing youtube video on google hub

How can I play a specific Youtube Video on my Google Hub via Google Actions? I know I can use a Basic Card to display images and text and even a link (although that link does not show up on the HUB)
I specifically want to be able to trigger or to play a youtube video on my Google Hub.
Actions are not able to start playing video content. Media responses are only for audio.
I have a similar need. After a chat with an action on google, I want to play user requested youtube videos (chains-of) on a local "big screen" (TV-like / PC).
A workaround solution could be:
you realize an action that select one or more videos.
The action act also as a server for a client described here below
The action communicate (SSE, websocket, HTTP...) with a client browser page containing a javascript small program that dynamically visualize the video (id sent via SSE client-server communication)
Here below the rough js script (I'm not a web developer); that just gives you the idea:
<script language="javascript">
function loadVideoWithId(id) {
const tvEmbedMode = "embed/" //"tv#/watch?v="
const url = `https://www.youtube.com/embed/${id}?fs=1&autoplay=1&loop=1` //
const iframe = `<iframe src="${url}" width="1600" height="900" allowFullScreen="allowFullScreen" frameBorder="0" />`
document.write(iframe)
}
loadVideoWithId('hHW1oY26kxQ')
</script>

Unable to send pdf file from bot to user in ms teams

NodeJS BotBuilder SDK version: 3.15.0
My code:
var pdf = {
name: '<file_name>.pdf',
contentType: 'application/pdf',
contentUrl: '<https url to public pdf file>'
};
var reply = new builder.Message(session).addAttachment(pdf);
session.send(reply);
This code is the same in few online examples. The issue I have is that I always get error:
Error: POST to 'https://smba.trafficmanager.net/emea/v3/conversations/a%3A1TwHmhoGuZP2Mf9P0TTnjv8HkcaXzEHryv0sYCvDDUI-qrMitJtHRlAnIcedcDH_v3IfMBXtg_zo5MDVcS0-8hDCQ4sJzpJhrewBPK8uWJXYeShgmd-s7uh5o8kW4ebAP/activities/1543588440246' failed: [400] Bad Request
For image/png this code works fine.
What I want to achieve is this: (image is taken from Bot Framework Emulator)
File from the web sent from bot to user
The file is sent from bot without uploading it to users's one drive.
This works also when I tested the feature in test section of https://dev.botframework.com/bots. It doesn't work only in ms teams.
The behaviour for sending files can differ per channel. Microsoft Teams doesn't support the direct upload method, like the WebChat / Emulator does. This is due to compliance reasons, as Bill Bliss stated.
You can post messages with card attachments referencing existing SharePoint files using the Microsoft Graph APIs for OneDrive and SharePoint. Using the Graph APIs requires obtaining access to a user's OneDrive folder (for personal and groupchat files) or the files in a team's channels (for channel files) through the standard OAuth2 authorization flow. This method works in all Teams contexts.
Have a look at Send and receive files through your bot
for the full documentation and how to implement.
An alternative option would be to use an AdaptiveCard where you can use an image thumbnail of the document combined with a button to directly download the PDF file from your public accessible URL.

Twitter API 1.1 OAuth Get Use Data

I read this tutorial to implement twitter oauth in nodejs (for "login with twitter" purpose) -
http://codetheory.in/how-to-use-twitter-oauth-with-node-oauth-in-your-node-js-express-application/
The last piece of code has this variable called results which is supposed to hold the user data sent back by twitter, but for me it only contains screen_name and user_id which is not enough. I need much more data like profile image, etc.
So I looked at the twitter documentation -
https://dev.twitter.com/docs/api/1/get/users/show
The sample URL seems to work fine -
https://api.twitter.com/1/users/show.json?screen_name=TwitterAPI&include_entities=true
But recently I read twitter will shut down API 1 soon and replace it with API 1.1
So I tried the 1.1 API -
https://dev.twitter.com/docs/api/1.1/get/users/show
The sample URL does not work -
https://api.twitter.com/1.1/users/show.json?screen_name=rsarver
Gives error -
{"errors":[{"message":"Bad Authentication data","code":215}]}
What am I doing wrong ? How do I get user info properly from twitter and hopefully in my Node.js code that uses this module - https://github.com/ciaranj/node-oauth ?
Thanks in advance!
API v1.1 endpoints require OAuth authentication.
You might look at a different oauth module: ntwitter

Monotouch video streaming with MPMoviePlayerController

I am creating a Monotouch iPhone app that will display streaming videos. I have been able to get the MPMoviePlayerController working with a local file (NSUrl FromFile), but have not been able to get videos streamed from a media server.
Here is the code I am using to play the video:
string url = #"http://testhost.com/test.mp4";
var nsurl = NSUrl.FromString(url);
mp = new MPMoviePlayerController(nsurl);
mp.SourceType = MPMovieSourceType.Streaming;
//enable AirPlay
//mp.AllowsAirPlay = true;
//Add the MPMoviePlayerController View
this.View.AddSubview(mp.View);
//set the view to be full screen and show animated
mp.SetFullscreen(true, true);
//MPMoviePlayer must be set to PrepareToPlay before playback
mp.PrepareToPlay();
//Play Movie
mp.Play();
Is there something else in implementing the MPMoviePlayerController for video streaming that I am missing? I also read that videos for iOS should be streamed using Apple's HTTP Live Streaming on the media server, is that a requirement? I have never worked with video streaming on an iOS device before so I am not sure if there is something lacking in my code or the media server setup or a combination.
I'm pretty sure you need a streaming server to use a video file from an HTTP url. However it's a requirement for applications (on the AppStore) to do so:
Important iPhone and iPad apps that send large amounts of audio or
video data over cellular networks are required to use HTTP Live
Streaming. See “Requirements for Apps.”
The good news is that your existing code should not have to be changed to handle this (it's server, not client side).

Resources