Skill for streaming Dropbox videos in alexa devices with screen (e.g: Echo Show)
-
Create a dropbox access token using the instructions here:- https://blogs.dropbox.com/developers/2014/05/generate-an-access-token-for-your-own-account/
-
Create a Alexa/ folder inside your Dropbox account and add any video files you want to stream
- Click on the green "Clone or download" button just under the yellow bar
- Click download ZIP
- Unzip the file
-
Go to http://aws.amazon.com/. You will need to set-up an AWS account (the basic one will do fine) if you don't have one already. Make sure you use the same Amazon account that your Echo device is registered to. Note - you will need a credit or debit card to set up an AWS account - there is no way around this. Please see the AWS Charges section above
-
Go to the drop down "Location" menu at the top right and ensure you select US-East (N. Virginia) if you are based in the US or EU(Ireland) if you are based in the UK or Germany. This is important as only these two regions support Alexa. NOTE: the choice of either US or EU is important as it will affect the results that you get. The EU node will provide answers in metric and will be much more UK focused, whilst the US node will be imperial and more US focused.
-
Select Lambda from the AWS Services menu at the top left
-
Click on the "Create a Lambda Function" or "Get Started Now" button.
-
Select "Blank Function" - this will automatically take you to the "Configure triggers" page.
-
Click the dotted box and select "Alexa Skills Kit" (NOTE - if you do not see Alexa Skill Kit as an option then you are in the wrong AWS region).
-
Click Next
-
Name the Lambda Function, e.g:-
dropboxPlayerSkill
-
Set a decription, e.g:-
Alexa Dropbox video player skill
-
Select the default runtime which is currently "node.js 6.10".
-
Select Code entry type as "Upload a .ZIP file".
- Click on the "Upload" button. Go to the folder where you unzipped the files you downloaded from Github, select index.zip and click open.
- Enter the following into the Environment Variables Section (If you are pasting in the Token then make sure you have no extra spaces: -
Key | Value |
---|---|
DROPBOX_TOKEN | (Put the Dropbox token in here) |
MEDIA_BUCKET | (Put your public S3 bucket name with images/logos here) |
- Keep the Handler as "index.handler" (this refers to the main js file in the zip).
- Under Role - select "Create a custom role". This will automatically open a new browser tab or window.
- Switch to this new tab or window.
- Under IAM Role select "Create a new IAM Role"
- Then press the blue "Allow" box at the bottom right hand corner. The tab/window will automatically close.
- You should now be back on the Lambda Management page. The Role box will have automatically changed to "Choose an existing role" and Role we just created will be selected under the "Existing role" box.
- Under Advanced Settings set Memory (MB) to 320 and change the Timeout to 0 minutes 30 seconds
- Once saved, click on the tab below code entry type and choose upload a .ZIP file. We will upload the video-streaming-alexa-skill.zip file to Lambda.
- Copy the ARN from the top right to be used later in the Alexa Skill Setup (it's the text after ARN - it won't be in bold and will look a bit like this arn:aws:lambda:eu-west-1:XXXXXXX:function:youtube). Hint - Paste it into notepad or similar.
-
In a new browser tab/window go to the Alexa Console (https://developer.amazon.com/edw/home.html and select Alexa on the top menu). If you have not registered as an Amazon Developer then you will need to do so. Once you are logged into your account go to to the Alexa tab at the top of the page.
-
Click on the yellow "Get Started" button under Alexa Skills Kit.
- Click the "Add a New Skill" box towards the top right.
-
You will now be on the "Skill Information" page.
-
Set "Custom Interaction Model" as the Skill type
-
Select the language as English (US) or English (UK)
-
Set the "Name" to
Dropbox video player
-
Set the "Invocation Name" to
Dropbox player
-
Set the "Audio Player" setting to "Yes"
-
Leave the other settings in Global Fields set to "No'
-
Click "Save" and then click "Next".
-
You will now be on the "Invocation Model" page.
-
Copy the text below into the "Intent Schema" box - Ignore the "Built-in intents for playback control box above"
{ "intents": [ { "intent": "AMAZON.StopIntent" }, { "intent": "AMAZON.NavigateSettingsIntent" }, { "intent": "AMAZON.MoreIntent" }, { "intent": "AMAZON.PageDownIntent" }, { "intent": "AMAZON.PageUpIntent" }, { "intent": "AMAZON.ScrollRightIntent" }, { "intent": "AMAZON.ScrollDownIntent" }, { "intent": "AMAZON.ScrollLeftIntent" }, { "intent": "AMAZON.ScrollUpIntent" }, { "intent": "AMAZON.HelpIntent" }, { "intent": "AMAZON.NextIntent" }, { "intent": "AMAZON.PreviousIntent" }, { "intent": "AMAZON.PauseIntent" }, { "intent": "AMAZON.ResumeIntent" }, { "slots": [ { "name": "number", "type": "AMAZON.NUMBER" } ], "intent": "NumberIntent" }, { "intent": "DemoIntent" }, { "slots": [ { "name": "search", "type": "SEARCH" }, { "name": "secondSearch", "type": "AMAZON.SportsTeam" } ], "intent": "SearchIntent" }, { "slots": [ { "name": "search", "type": "SEARCH" } ], "intent": "ShowIntent" }, { "intent": "EditAccountIntent" } ] }
-
Under Custom Slot Types:-
-
Type into the "Enter Type" field (NOTE - this is captialised) :-
SEARCH
-
Copy the text below and paste into the "Enter Values" box and then click "Add" (NOTE you must click ADD)
match prince video the fray the rolling stones ultra nate NYC Seattle Chelsea Portland
-
Copy the text below and paste them into the Sample Utterances box.
NumberIntent {number} NumberIntent play number {number} NumberIntent play track {number} NumberIntent play track number {number} DemoIntent demo SearchIntent play highlights from {search} match SearchIntent play highlights from the {search} and {secondSearch} match SearchIntent play {search} SearchIntent find {search} SearchIntent play some {search} SearchIntent play me some {search} SearchIntent videos by {search} SearchIntent for videos by {search} SearchIntent for audio by {search} ShowIntent show me videos from {search} ShowIntent show me the latest highlights from {search} ShowIntent show me the latest videos from {search}
- Click "Save" and then "Next".
- You will now be on the "Configuration" page.
- Select "AWS Lambda ARN (Amazon Resource Name)" for the skill Endpoint Type.
- Then pick the most appropriate geographical region (either US or EU as appropriate) and paste into the box (highlighted in red in the screenshot) the ARN you copied earlier from the AWS Lambda setup.
- Select "No" for Account Linking and leave everything under permissions unchecked
- Click "Save" and then "Next".
- There is no need to go any further through the process i.e. submitting for certification.
- You can start testing writing something like
Alexa, launch dropbox player
which will return a list of media players in the Dropbox Alexa/ folder and ask you what do you want to play. Right now the test service simulator do not simulate video or long audio so for fully testing the app and receiving video you will need an echo show.
- Readme and code pieces from: https://github.com/Fenton-Fenton-Fenton/alexa-tube
- Amazon Alexa Skill Kit: https://developer.amazon.com/alexa-skills-kit