Created
December 9, 2017 03:16
-
-
Save tifroz/04d067e0bfa53827fdd48959c51bb573 to your computer and use it in GitHub Desktop.
Google Cast: CAF receiver test for plain mp4 file
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<script type="text/javascript" | |
src="//www.gstatic.com/cast/sdk/libs/caf_receiver/v3/cast_receiver_framework.js"> | |
</script> | |
</head> | |
<body> | |
<cast-media-player></cast-media-player> | |
<script> | |
var context = cast.framework.CastReceiverContext.getInstance() | |
var playerManager = context.getPlayerManager() ; | |
context.start() ; | |
// Build the LoadRequestData object | |
var qi = new cast.framework.messages.QueueItem() ; | |
var media = new cast.framework.messages.MediaInformation() ; | |
// The media is file-based (mp4), no captions, it should not be loaded with xmlHttpRequest | |
media.contentId = "http://s3.amazonaws.com/web.swishly.com/webtv/test/Sample-Movie.mp4" ; | |
qi.media = media ; | |
var qd = new cast.framework.messages.QueueData(null, null, null, null, [qi], 0, 0) ; | |
var lrd = new cast.framework.messages.LoadRequestData() ; | |
lrd.queueData = qd ; | |
// Using a plain mp4, no captions/subtitles, this *should* just play | |
playerManager.load(lrd) | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment