本文介绍了通过向Chromecast设备提供平滑流的清单文件来播放平滑流URL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们想通过向Chromecast设备提供Smoothstreaming的清单文件来播放Smoothstreaming URL。

We want to play Smoothstreaming URL by providing Manifest file of smoothstreaming to Chromecast device.

我们可以在Chromecast设备
1上播放以下内容。 mp4文件
2. .ismv文件
3. .isma文件。

We could play the following on Chromecast device,1. .mp4 file2. .ismv file3. .isma file.

但是,如果我们提供以下清单文件,则不是能够在Chromecast设备上播放。

But, if we provide an Manifest file as follows, we are not able to play on Chromecast device.http://playready.directtaps.net/smoothstreaming/SSWSS720H264/SuperSpeedway_720.ism/Manifest

请让我们知道如何在Chromecast设备上播放Smoothstreaming URL。

Please let us know how to play Smoothstreaming URL on Chromecast device.

或者我们是否需要通过循环播放.ismv文件来一次播放它们。

Or do we need to play .ismv files one by one by providing them in a loop.

推荐答案

Chromecast支持通过其Media Player库流畅地播放内容:

The Chromecast has support for SmoothStreaming content through their Media Player Library: https://developers.google.com/cast/docs/player

下面是一个简单的实现。

Below is a bare bones implementation.

Google在GitHub上提供了一个合适的示例MediaManager和其他流媒体格式帐户的优势:)

Google provides a proper example on GitHub which takes advantage of the MediaManager and accounts for other streaming formats: https://github.com/googlecast/CastMediaPlayerStreamingDRM)

var $mediaElement = $('<video>').attr('autoplay', ''),
    mediaElement = $mediaElement[0],
    mediaUrl = "http://playready.directtaps.net/smoothstreaming/SSWSS720H264/SuperSpeedway_720.ism/Manifest",
    mediaHost,
    mediaPlayer;

cast.receiver.CastReceiverManager.getInstance().start();

$('body').append(mediaElement);

mediaHost = new cast.player.api.Host({
    mediaElement: mediaElement,
    url: mediaUrl
});

var protocol = cast.player.api.CreateSmoothStreamingProtocol(mediaHost);

mediaPlayer = new cast.player.api.Player(mediaHost);
mediaPlayer.load(protocol);

这篇关于通过向Chromecast设备提供平滑流的清单文件来播放平滑流URL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-11 20:39