2017-05-11 20 views
0

由於多次,我們正在嘗試將視頻上傳到Azure媒體服務並在移動設備上觀看。這適用於個人電腦,情況非常瘋狂。如何將視頻上傳到Azure媒體服務並在移動設備上觀看?

我們使用.NET API將視頻上傳到Azure媒體服務。 我們可以在Azure媒體播放器中觀看該視頻。但是從Azure管理以來就沒有了(可以選擇觀看視頻)。無論是在Azure媒體播放器示例查看器

然後......我們不知道問題出在Azure Administration,Azure Media Player還是我們上傳視頻(創建資產,編碼,創建定位器和策略...) 。

這是我的影片之一:http://media6franquiciasworldw.streaming.mediaservices.windows.net/e70ca01a-0be8-4f54-911c-6f4b85c0d396/12_mixtaSaltamontes.ism/manifest

這是我的代碼:

 //Creamos el ASSET a apartir de un archivo 
     IAsset inputAsset = _context.Assets.CreateFromFile(video.PathFile, AssetCreationOptions.StorageEncrypted); 

     //Encode/Codificación del vídeo. Transformamos el primer asset en otro que será el realmente difundido. Se usa un patrón (JSON/XML) definido en video.Enconder 
     IAsset encodedAsset = EncodeToAdaptiveBitrate(inputAsset, AssetCreationOptions.None, video.Enconder, video.GetAssetName(), video); 

     //If I use "AssetDeliveryProtocol.All", throw error: "Account is not enabled for HDS streaming" 
     IAssetDeliveryPolicy policy = _context.AssetDeliveryPolicies.Create("Clear Policy", AssetDeliveryPolicyType.NoDynamicEncryption, AssetDeliveryProtocol.SmoothStreaming, null); 
     encodedAsset.DeliveryPolicies.Add(policy); 

     // Publish the output asset by creating an Origin locator for adaptive streaming 
     _context.Locators.Create(
      LocatorType.OnDemandOrigin, 
      encodedAsset, 
      AccessPermissions.Read, 
      TimeSpan.FromDays(3650)); 

在這裏,這是我的「編碼器」:https://pastebin.com/zQ8rS73c

回答

0

我注意到幾個問題是這裏可能是錯的。

  1. 您是否已在您的帳戶中啓動並運行Streaming Endpoint?確保首先有。
  2. 請勿使用AssetDeliveryProtocol.All。 SDK中存在一個問題,它試圖添加到Adobe HDS中,我們正在放棄支持。您只想使用您需要的流式傳輸協議上使用的特定協議。所以使用下面的 模式: AssetDeliveryProtocol.SmoothStreaming | AssetDeliveryProtocol.Dash | AssetDeliveryProtocol.HLS | AssetDeliveryProtocol.ProgressiveDownload

你很可能沒有得到在iOS或Android客戶端的任何播放由於您只設置了協議,允許SmoothStreaming,這將僅適用於桌面或自定義支持移動客戶端。爲Android添加DASH,以及iOS的Apple HLS應該在這裏幫助。

+0

謝謝!使用:AssetDeliveryProtocol.SmoothStreaming | AssetDeliveryProtocol.Dash | AssetDeliveryProtocol.HLS 這工作! – user3809539

相關問題