【问题标题】:How to access audio file from the google cloud storage?如何从谷歌云存储访问音频文件?
【发布时间】:2020-01-18 07:02:06
【问题描述】:

我正在尝试从 html 音频标签中的谷歌文件存储访问音频文件 (https://storage.cloud.google.com/grad_production/SineWaveMinus16.wav)。 如何在angular 7中访问文件。

【问题讨论】:

    标签: angular google-cloud-platform google-cloud-storage


    【解决方案1】:

    我可以找到两个问题。

    1. 您可以使用标准 HTML 控件以角度播放音频
    <audio controls src={{filetoplay}}></audio>
    
    1. 您有权限问题吗?当我尝试下载您的文件时,它返回 403 http 错误(禁止)。如果是这样,您需要在您的存储帐户上设置规则,例如:
    service firebase.storage {
      match /b/{bucket}/o {
        match /{allPaths=**} {
          // allow access for all users
          allow read, write;
        }
      }
    }
    
    

    您可以在 firebase 控制台 -> 存储 -> 规则中进行设置。

    【讨论】:

    • 是的,面临同样的问题。无法在浏览器中访问文件
    猜你喜欢
    • 1970-01-01
    • 2017-05-13
    • 2019-10-15
    • 2019-08-24
    • 1970-01-01
    • 2014-09-04
    • 2021-04-25
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多