Comments (5)
Sorry, Gruntfile.js
is a mess now. I'll try to fix it.
from web-media-controller.
Thanks. As for the invidio.us support I'd like to contribute, I was wondering whether you could help me a little bit getting inside the code. I have a question:
I'm trying to understand the way a connector
works by reading the existing ones. As I see, the most important variables in a connector are the selectors I. If I give a selector (take nextButtonSelector
for example) a value of div#continue
and the first link inside it will lead to the next video, should it be good enough or should I find a selector that will lead straight to a link that targets the next video?
from web-media-controller.
If I give a selector (take nextButtonSelector for example) a value of div#continue and the first link inside it will lead to the next video, should it be good enough or should I find a selector that will lead straight to a link that targets the next video?
You could see content/base-connector.js
to make a better idea of what happens there. In this case, when next
signal comes from outside, connector.next()
is called. Its implementation in base-connector.js
among other things tries to get the first element that matches nextButtonSelector
and then tries to call elem.click()
. If there is no click()
able element, you could just implement next()
from scratch in your connector.
from web-media-controller.
I've also fixed Gruntfile.js
and corresponding README info.
from web-media-controller.
I've also fixed Gruntfile.js and corresponding README info.
Cool.
You could see content/base-connector.js to make a better idea of what happens there. In this case, when next signal comes from outside, connector.next() is called. Its implementation in base-connector.js among other things tries to get the first element that matches nextButtonSelector and then tries to call elem.click(). If there is no click()able element, you could just implement next() from scratch in your connector.
Wonderfully explained. One more question please regarding the mediaSelector
: I tried to set it to just video
with the hope that it will eventually make the playPause()
functions work just like in YouTube but it didn't work.
However, I've managed to test the addEventListener
in the console like so:
document.querySelector('video').addEventListener("pause", function(){ console.log("paused")})
I've also tried to use playButtonSelector
without success while I did managed to run this in the console:
document.querySelector('.vjs-play-control').click()
According to your explanation, both of these console tests should simulate what the extension does only with a few wrappers from content/utils.js
right?
from web-media-controller.
Related Issues (16)
- - in youtube videoID HOT 1
- Question: why properties canControl, canSeek &c set to true by default HOT 5
- npx grunt build failes: entry.isFile is not a function HOT 2
- Would you be interested in a CONTRIBUTING.md explaining how to add support for a new website? HOT 1
- Support several Invidious instances (dynamically?) HOT 7
- Support music.youtube.com HOT 1
- Расширение висит в статусе "Disconnected" HOT 3
- deezer connector not working HOT 2
- add bandcamp HOT 3
- Spotify connector no longer returning artist/track information HOT 2
- BaseConnector: Breakage of at least one metadata getter breaks all others
- Suggestion to update contributing guide
- Split dependencies
- Mozilla Add-ons link is broken HOT 3
- Yandex Music double switching HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from web-media-controller.