如何在Android上运行Azure Media Player [英] How to run azure media player on android

查看:40
本文介绍了如何在Android上运行Azure Media Player的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要将Azure媒体播放器集成到android应用中.

I have a requirement to integrate azure media player in an android app.

我在文档中看到的只是示例,以及有关如何将其添加到HTML文件中的信息.

All I can see in the documentation is sample and information on how to add this in an HTML file.

我有一个"... mainfest"文件,我需要从android应用程序中播放它.

I have a "...mainfest" file, and I need to play it from the android app.

我需要知道是否有适用于android的SDK,还是我需要在服务器上托管一个页面来播放这些视频?

I need to know if there is any SDK available for android, or do i need to host a page on server, which can play these videos?

已编辑

我在此处中检查了示例播放器,当我将视频网址传递给它时,或不带(format = m3u8-aapl-v3)"

I checked sample player here, when I pass my video URL to it, it loads video fine with or without "(format=m3u8-aapl-v3)"

但是我仍然无法从android应用程序中播放它.

But I am still unable to play it from android app.

我也试图创建一个HTML页面,但是它也不能播放视频.

I also tried to create an HTML page, but its also not playing the video.

这就是我在HTML文件中所做的.

This is what I did in HTML file.

<head>
</head>
<body>

   <video id="vid1" autoplay controls width="640" height="400" >
        <source src=".....ism/manifest(format=m3u8-aapl-v3)" />     
    </video>
</body>

推荐答案

更新

如果要以HTML格式播放,建议您使用官方示例代码,如下所示.

If you want play it in HTML, I recommend you use official sample code, like below.

有关更多详细信息,请您可以参考代码.

For more details, you can refer to the code.

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>Azure Media Player</title>
    <meta name="description" content="">
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <!--*****START OF Azure Media Player Scripts*****-->
    <!--Note: DO NOT USE the "latest" folder in production. Replace "latest" with a version number like "1.0.0"-->
    <!--EX:<script src="//amp.azure.net/libs/amp/1.0.0/azuremediaplayer.min.js"></script>-->
    <!--Azure Media Player versions can be queried from //amp.azure.net/libs/amp/latest/docs/changelog.html-->
    <script src="https://amp.azure.net/libs/amp/latest/azuremediaplayer.min.js"></script>
    <link href="https://amp.azure.net/libs/amp/latest/skins/amp-default/azuremediaplayer.min.css" rel="stylesheet">
    <!--*****END OF Azure Media Player Scripts*****-->

    <!--Add Plugins-->
    <!-- <script src="hotkeys.js"></script> -->

</head>
<body>
    <h1>Plugin - Hot Keys</h1>
    <video id="azuremediaplayer" class="azuremediaplayer amp-default-skin amp-big-play-centered" tabindex="0"> </video>
    <script>
        var myOptions = {
            autoplay: true,
            controls: true,
            width: "640",
            height: "400",
            poster: ""//,
            // plugins: {
            //     hotkeys: {
            //         //optional settings
            //         "volumeStep": 0.1,
            //         "seekStep": 5,
            //         "enableMute": true,
            //         "enableFullscreen": true,
            //         "enableNumbers": true,
            //         "enableJogStyle": false
            //     }
            // }
        };
        var myPlayer = amp("azuremediaplayer", myOptions);
        myPlayer.src([{ src: "https://amssamples.streaming.mediaservices.windows.net/91492735-c523-432b-ba01-faba6c2206a2/AzureMediaServicesPromo.ism/manifest", type: "application/vnd.ms-sstr+xml" }, ]);
    </script>
    <footer>
        <br />

        <p>© Microsoft Corporation 2016</p>
    </footer>

</body>
</html>

重要

您可以在网址末尾连接(format = m3u8-aapl-v3),可以在任何视频播放器中播放该网址.

You can concatenate (format=m3u8-aapl-v3) at the end of the URL, can play this url with any video player.

有关更多详细信息,您可以参阅此帖子.

For more details, you can refer to this post.

这篇关于如何在Android上运行Azure Media Player的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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