Bug 1768202 - Get the correct session id from netflix api. r=pip-reviewers,mhowell

Differential Revision: https://phabricator.services.mozilla.com/D145816
This commit is contained in:
Niklas Baumgardner 2022-05-07 15:38:31 +00:00
parent ffd6d97fc2
commit 34f2616c47

View File

@ -8,7 +8,13 @@ class PictureInPictureVideoWrapper {
constructor() {
let netflixPlayerAPI = window.wrappedJSObject.netflix.appContext.state.playerApp.getAPI()
.videoPlayer;
let sessionId = netflixPlayerAPI.getAllPlayerSessionIds()[0];
let sessionId = null;
for (let id of netflixPlayerAPI.getAllPlayerSessionIds()) {
if (id.startsWith("watch-")) {
sessionId = id;
break;
}
}
this.player = netflixPlayerAPI.getVideoPlayerBySessionId(sessionId);
}
play() {