【发布时间】:2015-07-13 16:47:11
【问题描述】:
我在我的示例应用程序中使用brightcove 来管理视频。我的示例应用程序基于Play-Framework 2.3.x、Scala、Angular-JS。问题是,我使用Angular-JS 使用Brightcove apis 将视频上传到brightcove 服务器。我的 Angular 代码如下:
$scope.uploadProcess= $upload.upload({
url: 'http://api.brightcove.com/services/post',
headers: {
'Content-Type': file.type
},
method: 'POST',
fields: {
"method": "create_video",
"params": {
"video": {
"name": filename,
"tags": [],
"shortDescription": filename,
"itemState": "ACTIVE"
},
-------------------------------------------
当我发送请求时,浏览器在响应时返回以下错误。
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://api.brightcove.com/services/post. This can be fixed by moving the resource to the same domain or enabling CORS.
通过在 Google 上搜索,我找到了一些解决方案,例如 Call Play 2 REST API with AngularJS (CORS Problems)。但没有任何工作。我真的被困在那种情况下,请提供解决方案。提前致谢。
【问题讨论】:
标签: angularjs scala playframework-2.3 brightcove