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 public url getter to return the currently playing url #6411

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

Conversation

ibobo
Copy link

@ibobo ibobo commented May 12, 2024

This PR will...

Make the url property a public getter, and create a private _url for internal use.

Why is this Pull Request needed?

As discussed in issue #6376, reading the currently playing url can be beneficial in some situations, and, since the url property exists and is marked as private, this was the best solution for the issue (as suggested by @robwalch).

Are there any points in the code the reviewer needs to double check?

No. But I didn't find a suitable spot to add something in the documentation, since also loadSource isn't documented.

Resolves issues:

#6376

Checklist

  • changes have been done against master branch, and PR does not conflict
  • new unit / functional tests have been added (whenever applicable)
  • API or design changes are documented in API.md

robwalch
robwalch previously approved these changes May 13, 2024
Copy link
Collaborator

@robwalch robwalch left a comment

Choose a reason for hiding this comment

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

It's missing a new entry in docs/API.md. Otherwise 👍

@robwalch robwalch added this to the 1.6.0 milestone May 13, 2024
@robwalch
Copy link
Collaborator

Hi @ibobo,

Would you mind adding an entry to docs/API.md for this new getter? Adding hls.url with description like the other getters ("get : string of current HLS asset passed to loadSource, otherwise null") under Network Loading Control API: https://github.com/video-dev/hls.js/blob/master/docs/API.md#network-loading-control-api

@ibobo
Copy link
Author

ibobo commented Jun 3, 2024

Sorry for the late response @robwalch, did that now!

Thanks

docs/API.md Outdated
- [Level](#level)
- [LevelDetails](#leveldetails)
- [Fragment](#fragment)
- [HLS.js v1 API](#hlsjs-v1-api)
Copy link
Collaborator

Choose a reason for hiding this comment

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

How did "HLS.js v1 API" get added to the TOCs?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Sorry for the late response @robwalch, did that now!

Thanks @ibobo,

Did you run npm run docs or tocdoc to update the table of contents? I only expect to see the addition of hls.url, not a new top level header (HLS.js v1 API). Please remove and/or only update the table of contents using npm run docs .

Copy link
Author

Choose a reason for hiding this comment

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

Sorry, didn't see that. I'm running npm run docs now.

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