Class StreamingProvidersRegistry


  • @Singleton
    public class StreamingProvidersRegistry
    extends Object
    Register of all streaming providers handled into Silverpeas.

    This permits also to control which streaming providers are allowed into Silverpeas.

    Author:
    silveryocha
    • Constructor Detail

      • StreamingProvidersRegistry

        public StreamingProvidersRegistry()
    • Method Detail

      • setupDefaults

        @PostConstruct
        protected void setupDefaults()
        The registry is filled by default from 'org.silverpeas.media.streaming.properties' file definitions.

        In order to handle other streaming providers, the property file MUST be completed. Or it is also possible to an additional library to add programmatically an other streaming provider.

      • getByName

        public Optional<StreamingProvider> getByName​(String name)
        Gets by name (which is considered as the identifier) the registered StreamingProvider instance if any.
        Parameters:
        name - a Silverpeas's identifier of streaming provider which is represented the name of the streaming provider.
        Returns:
        the aimed StreamingProvider is any.
      • getOembedUrl

        public Optional<String> getOembedUrl​(String streamingUrl)
        Gets the oembed url from the full URL of a streaming.

        oEmbed is a format for allowing an embedded representation of a URL on third party sites. The simple API allows a website to display embedded content (such as photos or videos) when a user posts a link to that resource, without having to parse the resource directly.

        All streaming providers implementing oembed services are listed here: https://oembed.com/providers.json

        Parameters:
        streamingUrl - the full url of a streaming.
        Returns:
        the oembed url as string.