Skip to content

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 brave#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

0 comments on commit 6a871e4

Please sign in to comment.