如何正确的视频文件从angularjs上传到Azure的媒体服务 [英] How to properly upload video files to Azure Media Services from angularjs

查看:947
本文介绍了如何正确的视频文件从angularjs上传到Azure的媒体服务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有关我的情况下,我们目前的应用程序是开始编码在HTML5和angularjs与网页API通信。我有一个工作流程的场景,我似乎无法找到一个端到端的例子。我想,让我的网站的用户上传视频和图片天青媒体服务。我发现了几个例子,似乎从网页数据移动到Blob存储,然后复制到蔚蓝的媒体服务。




  1. 是否有文件直接上传,而不必临时和永久的blob容器(一个连接到AMS)到媒体服务,这是一种,因为这种做法似乎逼我有一个额外的存储容器或者是有移动文件Blob存储随后通过连接的IAssetFile BLOB文件AMS的方法吗?

  2. 有人可以提供演示,从网络前端上传到AMS结束了该文件的流程结束的例子吗?

  3. 一旦在那里,有没有一种方法,以确保用户可以查看但不能下载视频?


解决方案

1.Is那里上传的文件直接向媒体服务的方式:




  • 媒体服务SDK需要您在我们的系统中首先创建一个资产对象。该资产目的是通过在储存容器支持。您可以创建一个空的资产对象,并要求只写SAS URL(我们称他们为定位器我们的API中)到您的内容直接上传到。你可能想看看这个AngularJS模块,看看它是否工作。 http://ngmodules.org/modules/angular-azure-blob-upload



2,可有人提供演示了web前端上传到AMS结束了该文件的流程结束的例子吗?




  • 您的Web API /前端应使用媒体服务SDK首先创建空的资产。一旦创建,携手共创一个只写SAS URL和手的回你的角客户端。然后,角客户端可以使用客户端的JavaScript库直接上传到使用SAS URL和Azure的BLOB模块团块/容器上传喜欢这里了一句:的 http://ngmodules.org/modules/angular-azure-blob-upload



3.一旦那里,是有办法,以确保用户可以查看但不能下载视频?




  • 一旦视频被上传,您应该删除从你的资产的定位符集合只写SAS定位器。这样一来,没有人可以用它来写一遍。

  • 在这一点上,你可以创建一个流媒体定位。用户将只能通过我们的流媒体服务流的文件。您的文件在,我们可以支持流媒体格式进行编码,所以您可能必须先揭开序幕的编码工作(与H264和AAC音频MP4文件)来得到它变成正确的格式和编码设置。如果你想从媒体服务流,你需要确保你至少有1对流您的帐户启用保留单位。此外,如果你正在寻找保护您的文件,你可以看看我们的内容保护服务,这将提供即时AES 128或PlayReady的DRM加密您的资产。您可以集成与JWT令牌和Active Directory认证/ AUTH用户他们能够解密在客户端视频前。


For my scenario, our current app is begin coded in html5 and angularjs communicating with web api. I have a workflow scenario that I seem to not be able to find an end to end example for. I would like to allow users of my website to upload videos and images to Azure Media Services. I found several examples that seem to move the data from a web page to blob storage and then copy over to azure media services.

  1. Is there a way to upload the file directly to Media Services, instead of having a temporary and permanent blob container(one tied to AMS), as this approach seems to force me to have an additional storage container or is there a way to move the file to blob storage followed by linking the blob file to AMS via IAssetFile?
  2. Can someone provide an end example that demonstrates the flow from web frontend upload to the file ending up in AMS?
  3. Once up there, is there a way to make sure users can view but not download videos?

解决方案

1.Is there a way to upload the file directly to Media Services:

  • The Media Services SDK requires you to first create an Asset object in our system. That Asset object is backed by a container in Storage. You can create an empty Asset object, and request a write only SAS URL (We call them "Locators" in our API) to upload your content directly into. You may want to check out this AngularJS module and see if it works. http://ngmodules.org/modules/angular-azure-blob-upload

2.Can someone provide an end example that demonstrates the flow from web frontend upload to the file ending up in AMS?

  • Your web API/frontend should use the Media Services SDK to create the empty Asset first. Once created, hand create a write only SAS URL and hand that back to your Angular client. The Angular client can then use client side javascript library to upload directly to the blob/container using the SAS URL and a module for azure-blob upload like the one here: http://ngmodules.org/modules/angular-azure-blob-upload

3.Once up there, is there a way to make sure users can view but not download videos?

  • Once the video is uploaded, you should Delete the Write only SAS "Locator" from your Asset's Locators collection. This way, nobody can use it to write again.
  • At this point you can create a Streaming Locator. Users will only be able to stream the file through our streaming services. Your file has to be encoded in a format that we can support streaming for, so you may have to first kick off an encoding job to get it into the right format and encoding settings (MP4 files with H264 and AAC audio). If you want to stream from Media Services, you need to make sure you have at least 1 streaming reserved unit enabled on your account. In addition, if you are looking to protect your files, you can take a look at our Content Protection services, which will provide on-the-fly AES 128 or PlayReady DRM encryption to your assets. You can integrate that with JWT tokens and Active Directory to authenticate/auth your users before they are able to decrypt the video on the client side.

这篇关于如何正确的视频文件从angularjs上传到Azure的媒体服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆