Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angularjs/22.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Angularjs Brightcove:使用Play Framework 2.3.x和Angular JS时出现CORS错误_Angularjs_Scala_Playframework 2.3_Brightcove - Fatal编程技术网

Angularjs Brightcove:使用Play Framework 2.3.x和Angular JS时出现CORS错误

Angularjs Brightcove:使用Play Framework 2.3.x和Angular JS时出现CORS错误,angularjs,scala,playframework-2.3,brightcove,Angularjs,Scala,Playframework 2.3,Brightcove,我在示例应用程序中使用brightcove管理视频。我的示例应用程序基于playframework2.3.x,Scala,angularjs。问题是,我使用Angular JS将视频上传到brightcove服务器,使用brightcove API。我的角度代码如下: $scope.uploadProcess= $upload.upload({ url: 'http://api.brightcove.com/services/post', heade

我在示例应用程序中使用
brightcove
管理视频。我的示例应用程序基于
playframework2.3.x
Scala
angularjs
。问题是,我使用
Angular JS
将视频上传到
brightcove
服务器,使用
brightcove API
。我的角度代码如下:

 $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.

通过在谷歌上搜索,我发现了一些解决方案,如。但什么都没用。我真的陷入了这种情况,请提供解决方案。提前谢谢

如果要从浏览器执行此类请求,需要确保服务器上已启用CORS

Brightcove似乎没有启用该功能,至少错误消息中说明了这一点

最简单的解决方案可能是,通过后端发布文件