awslabs / amplify-video

An open source Category Plugin for the AWS Amplify-CLI that makes it easy to deploy live and file based streaming video services and integrate them into your Amplify applications.
https://www.npmjs.com/package/amplify-category-video
Apache License 2.0
267 stars 56 forks source link

Best practices for GraphQL #291

Open leolorenzoluis opened 3 years ago

leolorenzoluis commented 3 years ago

Which Category is your question related to? Wiki

Based off https://github.com/awslabs/amplify-video/wiki/Troubleshooting

Provide additional details e.g. code snippets

In GridView-index.jsx there's a comment

//Replace Location 13 with this: (Please note that this is using not best practices of GraphQL) Contact sampatze@ if you want to know how to update.
const region = Amplify._config.aws_project_region;
this.setState({
  sources: [{
      src: `https://${awsvideo.awsOutputVideo}/${item.video.id}/${item.video.id}.m3u8`,
      type: 'application/x-mpegURL',
    }],
  displayingMovie: true,
  choosenItem: item,
  token: item.video.token,
});

I'd like to know what is the best practice?