mirror of
https://github.com/gosticks/PiPer.git
synced 2025-10-16 11:55:42 +00:00
Added Apple TV+ support
This commit is contained in:
parent
caaeeb01d9
commit
51d585da9c
@ -51,6 +51,7 @@ Install from the [Chrome Web Store](https://chrome.google.com/webstore/detail/pi
|
|||||||
|
|
||||||
## Supported sites
|
## Supported sites
|
||||||
* [9Now](http://www.9now.com.au)
|
* [9Now](http://www.9now.com.au)
|
||||||
|
* [Apple TV+](http://tv.apple.com)
|
||||||
* [Amazon Video](http://www.amazon.com/PrimeVideo)
|
* [Amazon Video](http://www.amazon.com/PrimeVideo)
|
||||||
* [Česká televize](http://www.ceskatelevize.cz)
|
* [Česká televize](http://www.ceskatelevize.cz)
|
||||||
* [CollegeHumor](http://www.collegehumor.com)
|
* [CollegeHumor](http://www.collegehumor.com)
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
46
src/common/scripts/resources/apple.js
Normal file
46
src/common/scripts/resources/apple.js
Normal file
@ -0,0 +1,46 @@
|
|||||||
|
export const domain = 'apple';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns nested shadow root
|
||||||
|
*
|
||||||
|
* @param {!Array<string>} selectors
|
||||||
|
* @return {?ShadowRoot}
|
||||||
|
*/
|
||||||
|
const getNestedShadowRoot = function(selectors) {
|
||||||
|
let dom = document;
|
||||||
|
for (const selector of selectors) {
|
||||||
|
dom = /** @type {HTMLElement} */ (dom.querySelector(selector));
|
||||||
|
dom = dom && dom.shadowRoot;
|
||||||
|
if (!dom) return null;
|
||||||
|
}
|
||||||
|
return /** @type {ShadowRoot} */ (dom);
|
||||||
|
}
|
||||||
|
|
||||||
|
export const resource = {
|
||||||
|
buttonClassName: 'footer__control hydrated',
|
||||||
|
buttonElementType: 'div',
|
||||||
|
buttonHoverStyle: /** CSS */ (`opacity: 0.8 !important`),
|
||||||
|
buttonInsertBefore: function(/** Element */ parent) {
|
||||||
|
return parent.lastChild;
|
||||||
|
},
|
||||||
|
buttonParent: function() {
|
||||||
|
const internal = getNestedShadowRoot(["apple-tv-plus-player",
|
||||||
|
"amp-video-player-internal"]);
|
||||||
|
if (!internal) return;
|
||||||
|
const fullscreenButton = internal.querySelector("amp-playback-controls-full-screen");
|
||||||
|
if (!fullscreenButton) return;
|
||||||
|
return fullscreenButton.parentElement;
|
||||||
|
},
|
||||||
|
buttonStyle: /** CSS */ (`
|
||||||
|
transition: opacity 0.15s;
|
||||||
|
cursor: pointer;
|
||||||
|
opacity: 0.9;
|
||||||
|
`),
|
||||||
|
videoElement: function() {
|
||||||
|
const video = getNestedShadowRoot(["apple-tv-plus-player",
|
||||||
|
"amp-video-player-internal",
|
||||||
|
"amp-video-player"]);
|
||||||
|
if (!video) return;
|
||||||
|
return video.querySelector('video');
|
||||||
|
},
|
||||||
|
};
|
||||||
@ -8,9 +8,9 @@
|
|||||||
<key>CFBundleIdentifier</key>
|
<key>CFBundleIdentifier</key>
|
||||||
<string>com.amarcus.safari.piper</string>
|
<string>com.amarcus.safari.piper</string>
|
||||||
<key>CFBundleShortVersionString</key>
|
<key>CFBundleShortVersionString</key>
|
||||||
<string>1.0.3</string>
|
<string>1.0.4</string>
|
||||||
<key>CFBundleVersion</key>
|
<key>CFBundleVersion</key>
|
||||||
<string>233</string>
|
<string>234</string>
|
||||||
<key>Developer Identifier</key>
|
<key>Developer Identifier</key>
|
||||||
<string>BQ6Q24MF9X</string>
|
<string>BQ6Q24MF9X</string>
|
||||||
<key>URL</key>
|
<key>URL</key>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user