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

Handle playlist of internet radio stations #4572

Merged

Conversation

ik666
Copy link
Contributor

@ik666 ik666 commented Apr 9, 2024

Added playlist support for handling internet radio stations. No transcoding yet (probably not neccesary for the usual codecs).

Feature can be tested with:

  • Generate Radio Browser playlist and copy it to a share (do not place to many radio stations inside playlist file, yet)

my_internet_radio_station.m3u file consists of radio stations like

#EXTM3U

#RADIOBROWSERUUID:962cc6df-0601-11e8-ae97-52543be04c81
#EXTINF:1,Dance Wave!
https://dancewave.online/dance.mp3
  • VLC navigating to VLC media player -> Universal Plug 'n Play -> UMS -> my_internet_radio_station.m3u -> radio

[x] cache radio station metadata in a table
transcoding". Maybe this is only cosmetic and can stay this way.
[x] read metadata from radio browser API if possible

SurfaceS and others added 30 commits March 3, 2024 11:26
fix HttpExchangeServletRequest Servlet implementation
implements v12 jetty.server
implements v12 jetty.client
# Conflicts:
#	pom.xml
#	react-client/package.json
#	react-client/yarn.lock
# Conflicts:
#	CHANGELOG.md
#	src/main/external-resources/logback.headless.xml
#	src/main/external-resources/logback.xml
V14 fix directory not found on scanner
fix NPE when UPnP device strangely do not have details (JUPnP).
# Conflicts:
#	pom.xml
#	react-client/package.json
#	react-client/yarn.lock
# Conflicts:
#	pom.xml
#	react-client/package.json
#	react-client/yarn.lock
# Conflicts:
#	pom.xml
#	react-client/package.json
#	react-client/yarn.lock
# Conflicts:
#	CHANGELOG.md
# Conflicts:
#	pom.xml
#	react-client/package.json
#	react-client/src/App.tsx
#	react-client/yarn.lock
# Conflicts:
#	CHANGELOG.md
…ed the same (UniversalMediaServer#4521)

* Fix TV series with the same title but different startYear being treated the same

* Removed null part

* Typo
@SurfaceS
Copy link
Contributor

SurfaceS commented May 28, 2024

I'm not reviewed the core goal of the PR. Only the Java part and UMS integration.

stop using 'code entered is invalid' to bypass normal code.
@SurfaceS
Copy link
Contributor

Tell me if I'm wrong, but I checked the code and I think that the changes in RequestV2 can be completely removed, as the server serve the media url to the client (as it should), so this part is never/should never been reached (and UMS is not a proxy).

For the other part (retrieving media/radio info), we should care that some users do not want that UMS browse the internet (that is why I put this in external).

@ik666
Copy link
Contributor Author

ik666 commented May 28, 2024

Tell me if I'm wrong, but I checked the code and I think that the changes in RequestV2 can be completely removed, as the server serve the media url to the client (as it should), so this part is never/should never been reached (and UMS is not a proxy).

If you want the playlists to work as intended, UMS needs to retrieve the data from the external radio station and stream it to the renderer (is kind of a proxy). The stream could also be transcoded if needed. The external URL could of course on top be presented as a res resource in the DIDL result. The control point/renderer should pick the right one (as proposed by the CDS v4 service doc).

For the other part (retrieving media/radio info), we should care that some users do not want that UMS browse the internet (that is why I put this in external).

But: If UMS is not connecting to the internet, it can not serve the radio station. Then this feature won't work.

@ik666
Copy link
Contributor Author

ik666 commented May 29, 2024

@SurfaceS I'm unsure who made the change: it looks like RequestV2 is serving only WebAudioStreams now. I think this was initially matching WebStream as this would also let playlists of VideoStreams work like IPTV playlists. I haven't tested video playlists yet, though.

@ik666
Copy link
Contributor Author

ik666 commented May 31, 2024

@SubJunk Do you want to check it now? For my playlist it's working.

@SurfaceS
Copy link
Contributor

@SurfaceS I'm unsure who made the change: it looks like RequestV2 is serving only WebAudioStreams now. I think this was initially matching WebStream as this would also let playlists of VideoStreams work like IPTV playlists. I haven't tested video playlists yet, though.

I did it.

You was overriding the isCodeValid method of WebAudioStream (wtf... that is to check if the entered code is valid) to bypass the normal handle in RequestV2, then you check if the item is a WebStream to run your own code.
So a VideoStreams was never reaching your code (or it was a real blocked media with code is invalid !).

BTW, the RequestV2 should not to be changed, as it is not intended to create a stream for an item.
Stream things are handled by the StoreItem itself. And StoreItem itself will use an engine stream when needed.

For now, without any change WebAudioStream are served fine.
You can try adding a new shared content like your test url (https://dancewave.online/dance.mp3) to it and see that.
So why changing something that is running fine.


PR
Handling Playlist that may contain a third party #RADIOBROWSERUUID, why not if users are aware of it.
Decorate a WebAudioStream with a possibly de.sfuhrm.radiobrowser4j.RadioBrowser same a last one.
Decorate a WebAudioStream by extracting audio information from ice or icecast protocol is nice.
Storing WebStream Metadata is nice.

The others are in my pov (and only my point of view) unproductive / pollute a lot.
Most code should sit under the WebAudioStream itself, not playlist.
-> PlaylistFolder create a WebAudioStream, advise WebAudioStream that is has a #RADIOBROWSERUUID, WebAudioStream do the stuff itself.


privacy

For the other part (retrieving media/radio info), we should care that some users do not want that UMS browse the internet (that is why I put this in external).

But: If UMS is not connecting to the internet, it can not serve the radio station. Then this feature won't work.

adding the radio station as a shared content, and UMS going itself browsing a third party metadata server is not the same at all.

@ik666
Copy link
Contributor Author

ik666 commented May 31, 2024

@SurfaceS I'm actually fine with the changes. The streams are served as expected.

@SurfaceS
Copy link
Contributor

@ik666 I checked the RequestV2 changes, and that break transcoding for WebAudioStream from shared content when renderer cannot handle stream.

I made a PR on your git (ik666#89) that should fix most of my previous post remarks, and add thumbnail creation.

Have a shoot and let me know if it is something wrong on it.

@SubJunk
Copy link
Member

SubJunk commented May 31, 2024

@ik666 I'm excited to test the feature, just waiting for the code review conversations to be resolved before I test :)

sf666 added 2 commits June 5, 2024 11:23
* main_UMS:
  14.1.0
  fix UniversalMediaServer#4715 (UniversalMediaServer#4730)
  Bump the typescript-eslint group in /react-client with 2 updates (UniversalMediaServer#4719)
  Bump @types/react from 18.3.2 to 18.3.3 in /react-client (UniversalMediaServer#4720)
  Bump axios from 1.6.8 to 1.7.2 in /react-client (UniversalMediaServer#4721)
  Bump org.apache.maven.plugins:maven-enforcer-plugin from 3.4.1 to 3.5.0 (UniversalMediaServer#4725)
  Bump the mantine group in /react-client with 6 updates (UniversalMediaServer#4718)
  Bump jetty.version from 12.0.8 to 12.0.9 (UniversalMediaServer#4724)
  Bump commons-logging:commons-logging from 1.3.1 to 1.3.2 (UniversalMediaServer#4726)
  Bump com.puppycrawl.tools:checkstyle from 10.12.7 to 10.17.0 (UniversalMediaServer#4723)
  Sync with Crowdin and changelog fixes/updates
  Bump com.sun.xml.bind:jaxb-impl from 4.0.4 to 4.0.5 (UniversalMediaServer#4711)
  Founded -> Found
  fix X_GetFeatureList (UniversalMediaServer#4714)
  Bump org.codehaus.mojo:exec-maven-plugin from 3.2.0 to 3.3.0 (UniversalMediaServer#4709)
  Bump the typescript-eslint group in /react-client with 2 updates (UniversalMediaServer#4705)
  Bump @types/lodash from 4.17.1 to 4.17.4 in /react-client (UniversalMediaServer#4706)
  Bump com.github.oshi:oshi-core from 6.6.0 to 6.6.1 (UniversalMediaServer#4710)
* main-ikefix:
  fix 2 quick shoot
  fix 2 quick shoot
  fix quick shoot
@ik666
Copy link
Contributor Author

ik666 commented Jun 5, 2024

@SurfaceS I see some issues with the following playlist entry.

#EXTM3U


#EXTINF:1,Discover Trance
https://www.discovertrance.com/DiscoverTrance-high.m3u

The items inside this playlist are identified as WebVideoStream and do not play any more. This was not the case before the merge. I believe the logic for identifying the content type (of the playlist entries) was removed. Quick look: Problem is that the WebStreamMetadata doesn't have the type information any more and the PlaylistFolder is not testing against that type any more ... You can test your branch also in the ums web ui I believe. It's playing sound if it's working ...

@SurfaceS SurfaceS changed the base branch from main to m3u_uri_handling June 5, 2024 13:10
@SurfaceS SurfaceS merged commit cd8dce8 into UniversalMediaServer:m3u_uri_handling Jun 5, 2024
10 checks passed
@SurfaceS
Copy link
Contributor

SurfaceS commented Jun 5, 2024

Sorry, merging this to m3u_uri_handling has closed it.

I corrected thing in this PR.
https://github.com/ik666/UniversalMediaServer/pull/90/files

@ik666
Copy link
Contributor Author

ik666 commented Jun 5, 2024

I think this is just OK ... thanks !

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

5 participants