Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add element monitoring to avoid the need to update URLs in manifest.json #11

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

ryo-fujinone
Copy link

@ryo-fujinone ryo-fujinone commented May 12, 2024

I added monitoring of video player element.
I did the test only on amazon.co.jp, but as far as I googled, it seems that #dv-web-player is also used by Prime Video other than amazon.co.jp, so I think this change probably won't be a problem.

@fabrebatalla18
Copy link

Seeing that you are maintaining the project, and sorry for the offtopic, but would it be possible for you to add a menu with resolution settings? It would be very useful for people who have a somewhat slow internet, for example to be able to always load the video in 720p instead of 1080p, so those people with a slow internet would not have drops at 480p or lower.

@ryo-fujinone
Copy link
Author

Seeing that you are maintaining the project, and sorry for the offtopic, but would it be possible for you to add a menu with resolution settings? It would be very useful for people who have a somewhat slow internet, for example to be able to always load the video in 720p instead of 1080p, so those people with a slow internet would not have drops at 480p or lower.

There are several challenges to changing resolution using extensions.

This extension works by intercepting access to the mpd file (list of mp4 URLs by resolution and bandwidth) for each content and changing it to an mpd file with only the maximum resolution mp4 URL.
Access to the mpd occurs only once before video playback starts, so it is not possible to instantly change the resolution using this extension method during video playback.
It is not impossible to have an optional feature on the video player UI, but it would probably require reloading the page after the option change.
In addition, each content has different aspect ratios, supported resolutions, and bandwidths, so implementation of appropriate options for all content requires research.

Since Prime Video has separate video and audio files, it would be ideal to be able to switch not only video but audio as well if internet speed is a concern.Research will be required to implement appropriate options for audio as well.

I think the easiest solution would be to implement a bandwidth option without considering resolution.
In that case, I think we could make sure that any content uses the video/audio for the bandwidth closest to the bandwidth that has been set in the past.

For users who prefer a particular resolution, it might be possible to look at the height (or width) value of each mp4 described in the mpd and use the mp4 closest to the value set by the user.

I'm sorry, I can't determine what the best implementation would be. I may look into it when I have the time and motivation.

@fabrebatalla18
Copy link

I think the best way is something like this, for example, the second best bandwitch and the second height resolution:

if (!(representations[i].getAttribute('height') == heights[1].toString() && representations[i].getAttribute('bandwidth') == bandwidths[1].toString())) {

@ryo-fujinone
Copy link
Author

I think the best way is something like this, for example, the second best bandwitch and the second height resolution:

if (!(representations[i].getAttribute('height') == heights[1].toString() && representations[i].getAttribute('bandwidth') == bandwidths[1].toString())) {

Prime Video has some content that only has low-resolution mp4s (less than 720p), so if you want to implement something like "nth resolution", it would be appropriate to make it an option that only applies to arbitrary content, rather than an option for all content.
Also, your example may not always work as there may be multiple 1080p mp4s with different bandwidth support.
I think careful research is needed to implement a resolution change option that satisfies users.

@ryo-fujinone ryo-fujinone changed the title Add element monitoring to avoid the need to update URLs in manifest.json. Add element monitoring to avoid the need to update URLs in manifest.json May 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants