简体   繁体   English

将源设置为Azure媒体播放器

[英]Setting source to a azure media player

I have a azure media player embedded in my SharePoint page. 我的SharePoint页面中嵌入了一个Azure媒体播放器。 The source to the file to be played is set dynamically through a script file.Th source files can be of wmv/mp4/mpg formats and retrived from a sharepoint video portal. 要播放的文件的源是通过脚本文件动态设置的。源文件可以是wmv / mp4 / mpg格式,可以从sharepoint视频门户检索。

However the source is not being set or it throws some error. 但是,未设置源,否则会引发一些错误。 Please find the code below. 请在下面找到代码。

HTML: HTML:

<video id="vid1" class="azuremediaplayer amp-default-skin video-responsive" autoplay controls width="100%" height="100%" poster="poster.jpg">

    <p class="amp-no-js">
        To view this video please enable JavaScript, and consider upgrading to a web browser that supports HTML5 video
    </p>
</video>

JS: JS:

var myPlayer = amp('vid1', { /* Options */
                                 "nativeControlsForTouch": false,
                                 autoplay: false,
                                 controls: true,
                                  width: "640",
                                  height: "400",
                                 poster: ""
                                 }, function() {
                                          console.log('Good to go!');
                                         // add an event listener
                                            this.addEventListener('ended',         function() {
                                            console.log('Finished!');
                                                        });
                                                }
                                );

myPlayer.src([{ 

    "src": "<<URL to the source file in video portal>>", 
    "type":  "type": "application/vnd.ms-sstr+xml"
}]); 

The mime type you're using in your given code implies that you're trying to set a smoothstreaming source (application/vnd.ms-sstr+xml) if you are setting the source as an MP4 you should use the mime type video/mp4 您在给定代码中使用的MIME类型表示如果您要将源设置为MP4,则应尝试设置平滑流源(application / vnd.ms-sstr + xml),而应使用video / MP4

myPlayer.src([{ src: "YOUR_SOURCE.mp4", type: "video/mp4" }]);

you can check out this sample which plays back progressive MP4 content from the Azure Media Player samples page 您可以从Azure Media Player 示例页面中检出该示例以播放渐进MP4内容

Also, I'm not sure if this was a typo or not but you have "type": included in your code twice. 另外,我不确定这是否是拼写错误,但您有两次"type":在代码中包含两次。

Please refer to https://amp.azure.net/libs/amp/latest/docs/ . 请参考https://amp.azure.net/libs/amp/latest/docs/

Authentication token of a sharepoint videoportal file can be retreived using GetStreamingKeyAccessToken rest service. 可以使用GetStreamingKeyAccessToken rest服务获取共享点视频门户文件的身份验证令牌。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在Azure Media Player上插入按钮 - Inserting buttons on Azure Media Player 当来源是IE / EDGE上的加密令牌视频时,Canvas无法从Azure Media Player中绘制Image - Canvas not drawImage from azure media player when source is encrypted token video on IE/EDGE 使用ajax设置html5媒体源 - Setting html5 media source using ajax 海报图像在视频中不起作用,并且azure媒体播放器的版本1.5.0更新 - Poster image is not working in videos, with version 1.5.0 update of azure media player Azure Media Player在浅灰色弹出窗口上的第二次单击时未播放视频 - Azure Media Player is not playing video on second click on lightgray popup Azure 媒体播放器的多个实例渲染音量控制无用 - Multiple instances of Azure Media Player render volume control useless 是否可以使用其 javascript API 为 azure 媒体播放器选择质量? - Is it possible to select a quality for the azure media player using its javascript API? 全屏Azure Media Player方形纵横比视频 - Azure Media Player square aspect ratio videos fullscreen Azure 媒体播放器 drm 保护 iPhone 中的视频问题 - Azure media player drm protected video issue in iPhone Firefox在没有激活DRM的情况下在Azure Media Player上显示DRM警告 - Firefox displays DRM warning on Azure Media Player without DRM active
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM