Created
June 29, 2015 00:10
-
-
Save OstlerDev/898bbc3b2dce5639c823 to your computer and use it in GitHub Desktop.
Netflix Play Next
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
atv.player.loadRelatedPlayback = function(a, callback){ // I have no idea what "a" is, but the callback sends the preplay XML back. | |
var o = atv.player.asset.getElementByTagName("myMetadata"), | |
t = o && o.getElementByTagName("relatedPlaybackURL"), | |
url = t && t.textContent; | |
handlePostPlay(url, callback); | |
} | |
function handlePostPlay(url, callback) { | |
// Load the Preplay XML | |
var req = new XMLHttpRequest(); | |
req.open('GET', url, false); | |
req.send(); | |
// Pull the document and get the XML | |
var doc=req.responseXML; | |
// Return the XML to the Apple TV | |
callback.success(doc); | |
} |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<atv> | |
<body> | |
<videoPlayer id="AtvVideoAssetView"> | |
<httpLiveStreamingVideoAsset id="assetID"> | |
<mediaURL>Media URL</mediaURL> | |
<title>Episode Title</title> | |
<description>Episode Description.</description> | |
<image>Episode Image</image> | |
<upNextPresentationTime>2511</upNextPresentationTime> | |
<upNextPresentationDuration>20</upNextPresentationDuration> | |
<myMetadata> | |
<relatedPlaybackURL>link to post play XML</relatedPlaybackURL> | |
</myMetadata> | |
<bookmarkTime>0</bookmarkTime> | |
<subtitleStylesURL>http://webvtt.nflxvideo.net/4/WebVTTStyle.plist</subtitleStylesURL> | |
</httpLiveStreamingVideoAsset> | |
</videoPlayer> | |
</body> | |
</atv> |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<atv> | |
<body> | |
<relatedPlayback> | |
<upNextItem id="AtvPostPlayVideoAssetView" onSelect=""> | |
<httpLiveStreamingVideoAsset id="assetID"> | |
<mediaURL>Media URL</mediaURL> | |
<title>Episode Title</title> | |
<description>Episode Description.</description> | |
<image>Episode Image</image> | |
<upNextPresentationTime>2500</upNextPresentationTime> | |
<upNextPresentationDuration>20</upNextPresentationDuration> | |
<bookmarkTime>0</bookmarkTime> | |
<subtitleStylesURL>http://webvtt.nflxvideo.net/4/WebVTTStyle.plist</subtitleStylesURL> | |
</httpLiveStreamingVideoAsset> | |
</upNextItem> | |
<optionsMenu> | |
<sections> | |
<menuSection> | |
<items> | |
<oneLineMenuItem id="nextEpisode" onSelect=""> | |
<label>Play Next Episode</label> | |
</oneLineMenuItem> | |
<oneLineMenuItem id="moreEpisodes" onSelect=""> | |
<label>More Episodes</label> | |
</oneLineMenuItem> | |
</items> | |
</menuSection> | |
</sections> | |
</optionsMenu> | |
</relatedPlayback> | |
</body> | |
</atv> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment