Class MediaSource

  • All Implemented Interfaces:
    com.longtailvideo.jwplayer.utils.Jsonable

    public class MediaSource
    extends java.lang.Object
    implements com.longtailvideo.jwplayer.utils.Jsonable
    • Constructor Detail

      • MediaSource

        public MediaSource​(java.lang.String file)
      • MediaSource

        public MediaSource​(java.lang.String file,
                           java.lang.String label,
                           boolean _default,
                           MediaType type,
                           java.util.Map<java.lang.String,​java.lang.String> httpHeaders)
      • MediaSource

        public MediaSource()
    • Method Detail

      • getFile

        @Nullable
        public java.lang.String getFile()
        Returns:
        URL to the video file, audio file, or live stream of this playlist item source.
      • getLabel

        @Nullable
        public java.lang.String getLabel()
        Returns:
        Label of the media source, displayed in the manual quality selection menu. Set this if you have more than 2 qualities of your video.
      • getDefault

        public boolean getDefault()
        Returns:
        Set this to true for the media source you want to play on startup. If this isn't set for any source, the first one is used
      • getType

        public MediaType getType()
        Returns:
        Forces a media type. Only required when a file extension is missing or not recognized (Using .php or certain tokens, for example).
      • getHttpHeaders

        @Nullable
        public java.util.Map<java.lang.String,​java.lang.String> getHttpHeaders()
        Returns:
        HTTP Headers to include with requests for this media file.
      • setFile

        public void setFile​(java.lang.String file)
        Parameters:
        file - URL to the video file, audio file, or live stream of this playlist item source.
      • setLabel

        public void setLabel​(java.lang.String label)
        Parameters:
        label - Label of the media source, displayed in the manual quality selection menu. Set this if you have more than 2 qualities of your video.
      • setDefault

        public void setDefault​(boolean _default)
        Parameters:
        _default - Set this to true for the media source you want to play on startup. If this isn't set for any source, the first one is used
      • setType

        public void setType​(MediaType type)
        Parameters:
        type - Forces a media type. Only required when a file extension is missing or not recognized (Using .php or certain tokens, for example).
      • setHttpHeaders

        public void setHttpHeaders​(java.util.Map<java.lang.String,​java.lang.String> httpHeaders)
        Parameters:
        httpHeaders - HTTP Headers to include with requests for this media file.
      • parseJson

        public static MediaSource parseJson​(org.json.JSONObject json)
                                     throws org.json.JSONException
        Throws:
        org.json.JSONException
      • parseJson

        public static MediaSource parseJson​(java.lang.String json)
                                     throws org.json.JSONException
        Throws:
        org.json.JSONException
      • toJson

        public org.json.JSONObject toJson()
        Specified by:
        toJson in interface com.longtailvideo.jwplayer.utils.Jsonable
      • parseTypeFromFile

        public static MediaType parseTypeFromFile​(java.lang.String file)
      • typeAsMediaType

        public static MediaType typeAsMediaType​(java.lang.String fileType)