I have a .mp4 video file located in an ADLS Gen2 storage account that I am trying to display in a simple Flask webapp. For simplicity’s sake I am hardcoding all of the URL’s until I am able to get it to work.
When I enter the URL without a SAS in the connection string, the webpage displays: ResourceNotFoundThe specified resource does not exist. RequestId:xxxx-xxxx-xxxx-xxxx-xxxx Time:xxxx.
When I append the SAS to the end of the URL, my browser downloads the file, but it doesn’t display it on the page.
I am trying to display the video in the browser, and have the ability to play it (in browser). Below is my code, any input it greatly appreciated!
@app.route('/playVideo/', methods=['GET'])
def playVideo():
return render_template('playVideo.html')
{% extends 'base.html' %}
{% block content %}
<h1>Hello world!</h1>
<iframe src="https://mystorageaccount.blob.core.windows.net/video/xxx-xxx-xxx/xxx-xxx-xxx..mp4" width="853" height="480" frameborder="0" allowfullscreen></iframe>
{% endblock %}
>Solution :
When I enter the URL without a SAS in the connection string, the
webpage displays: ResourceNotFoundThe specified resource does not
exist. RequestId:xxxx-xxxx-xxxx-xxxx-xxxx Time:xxxx.
This is happening because the ACL of the blob container is set as Private. If you want to access a blob directly by its URL, you will need to set the ACL of the blob container to be either Blob or Public.
When I append the SAS to the end of the URL, my browser downloads the
file, but it doesn’t display it on the page.
Please check the content-type property of the blob. In all likelihood, it is set as application/octet-stream. Update the blob property and change it’s content-type property to video/mp4 and that should take care of this problem.