How to run azure media player on android

喜欢而已 提交于 2021-02-11 14:31:52

问题


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

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

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

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?

Edited

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

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

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

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>

回答1:


UPDATE

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>

PRIVIOUS

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.



来源:https://stackoverflow.com/questions/64269617/how-to-run-azure-media-player-on-android

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!