Skip to content
This repository has been archived by the owner on Dec 11, 2019. It is now read-only.

Commit

Permalink
Add Widevine support for Amazon Prime Video
Browse files Browse the repository at this point in the history
Auditors: @aekeus

Test Plan:
The heuristic is not super good for determining if widevine prompt should come up so we really need to make sure it doesn't come up on other amazon pages, but does come up on Amazon prime video relaed pages.  I suggest testing this with disabled widevine so you get the dialog and know when the heuristic is hit
Other heuritstics I tried that didn't work was URLs /dp/ (some other
products have this), and s=instant_video (some videos don't have this)

Fix #5233
  • Loading branch information
bbondy committed Oct 29, 2016
1 parent f5ae0fc commit 6a871e4
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion js/components/frame.js
Original file line number Diff line number Diff line change
Expand Up @@ -650,10 +650,14 @@ class Frame extends ImmutableComponent {
showWidevineNotification (location, origin, noWidevineCallback, widevineCallback) {
// https://www.nfl.com is said to be a widevine site but it actually uses Flash for me Oct 10, 2016
const widevineSites = ['https://www.netflix.com',
'https://www.amazon.com',
'http://bitmovin.com',
'https://shaka-player-demo.appspot.com']
const isForWidevineTest = process.env.NODE_ENV === 'test' && location.endsWith('/drm.html')
if (!isForWidevineTest && (!origin || !widevineSites.includes(origin))) {
if (!isForWidevineTest && (!origin || !widevineSites.includes(origin)) ||
// We don't want a widevine prompt unless the user hits a URL containing pf_rd_i=
// I'll assume all video URLs have pf_rd_i= video until Alex, Sriram, or Suguru tell me otherwise...
origin === 'https://www.amazon.com' && !location.includes('pf_rd_i=')) {
noWidevineCallback()
return
}
Expand Down

2 comments on commit 6a871e4

@bsclifton
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could these URLs go into js/constants/config.js? might be a lot cleaner 😄

@bbondy
Copy link
Member Author

@bbondy bbondy commented on 6a871e4 Oct 31, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe urlUtil helper w/ test since it has some more than just constants check logic

Please sign in to comment.