简体   繁体   English

Limelight视频播放器|| 如何用它播放HTML5视频

[英]Limelight Video Player || How to play HTML5 video with it

Currently, I am facing issue with Limelight player. 目前,我正面临着Limelight播放器的问题。 It is playing flash videos with Limelight player and player ID is the argument which is passed for the flash videos. 它正在使用Limelight播放器播放Flash视频,播放器ID是为Flash视频传递的参数。

Flash player videos are causing issue and we need to change the approach to play HTML5 videos instead of flash player.But I can't see or find any relevant code in which video stream from limelight player can be feed into the HTML5 player. Flash播放器视频导致问题,我们需要更改播放HTML5视频而不是Flash播放器的方法。但我无法查看或找到任何相关代码,其中来自limelight播放器的视频流可以输入HTML5播放器。

Any suggestions or code snippets for making Limelight videos being played with the HTML5 player will be very helpful. 使用HTML5播放器播放Limelight视频的任何建议或代码片段都将非常有用。

Regards 问候

I am currently working on it and its bit of complex but here is what limelight came with : 我目前正在研究它并且它有点复杂,但这里是风头之光:

   <div id="limelight_player_659410"></div><script src="//video.limelight.com/player/limelightjs-player.js"></script>
<script>LimelightPlayerUtil.embed({"height":321,"playerId":"limelight_player_659410","width":480,"mediaId":"c3713feac461425e8889d55689358352","playerForm":"Player"});</script>

First approach is to create limelight callback function: 第一种方法是创建风头回调函数:

function limelightPlayerCallback(playerId, eventName, data) {
   console.dir(data); 
   colsole.log(data.thumbnailUrl);
   console.log(data.title);
   console.log(data.description);

}

So when you call : LimelightPlayerUtil.embed({"width":"480px","height":"300px", "playerId":"HEREisYOURcontainerID", "mediaId":"HEREisYOURmediaId", "playerForm":"Player"}); 所以当你打电话时:LimelightPlayerUtil.embed({“width”:“480px”,“height”:“300px”,“playerId”:“HEREisYOURcontainerID”,“mediaId”:“HEREisYOURmediaId”,“playerForm”:“Player”} );

your limelightPlayerCallback will get "data". 你的limelightPlayerCallback将得到“数据”。

Now you can see in console all data.proprties and use which one you want to manipulate HTML5 Video tag and display data. 现在,您可以在控制台中看到所有data.proprties,并使用您想要操作HTML5视频标签和显示数据的那个。

Second approach : Not sure if this link is valid by limelight but I was able to get it from calls I was making : 第二种方法 :不确定这个链接是否有效,但是我能够从我正在进行的调用中得到它:

https://production-ps.lvp.llnw.net/r/PlaylistService/media/d7d5b0ec19e1441781c3df4209fe5cb6/getMobilePlaylistByMediaId https://production-ps.lvp.llnw.net/r/PlaylistService/media/d7d5b0ec19e1441781c3df4209fe5cb6/getMobilePlaylistByMediaId

This link will return JSON with all properties. 此链接将返回包含所有属性的JSON。 Please note that "d7d5b0ec19e1441781c3df4209fe5cb6" is video ID so replace and use any of your video IDs. 请注意,“d7d5b0ec19e1441781c3df4209fe5cb6”是视频ID,因此请替换并使用您的任何视频ID。 Once you get JSON you will get URL and you can inject HTML5 video tag :) 一旦你获得JSON,你将获得URL,你可以注入HTML5视频标签:)

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM