added java doc for stream

This commit is contained in:
yausername 2019-03-23 19:11:51 +05:30
parent 07a8129a73
commit aabc65b57d
1 changed files with 33 additions and 0 deletions

View File

@ -16,10 +16,23 @@ public abstract class Stream implements Serializable {
@Deprecated @Deprecated
public final int format; public final int format;
/**
* Instantiates a new stream object.
*
* @param url the url
* @param format the format
*/
public Stream(String url, MediaFormat format) { public Stream(String url, MediaFormat format) {
this(url, null, format); this(url, null, format);
} }
/**
* Instantiates a new stream object.
*
* @param url the url
* @param torrentUrl the url to torrent file, example https://webtorrent.io/torrents/big-buck-bunny.torrent
* @param format the format
*/
public Stream(String url, String torrentUrl, MediaFormat format) { public Stream(String url, String torrentUrl, MediaFormat format) {
this.url = url; this.url = url;
this.torrentUrl = torrentUrl; this.torrentUrl = torrentUrl;
@ -52,18 +65,38 @@ public abstract class Stream implements Serializable {
return false; return false;
} }
/**
* Gets the url.
*
* @return the url
*/
public String getUrl() { public String getUrl() {
return url; return url;
} }
/**
* Gets the torrent url.
*
* @return the torrent url, example https://webtorrent.io/torrents/big-buck-bunny.torrent
*/
public String getTorrentUrl() { public String getTorrentUrl() {
return torrentUrl; return torrentUrl;
} }
/**
* Gets the format.
*
* @return the format
*/
public MediaFormat getFormat() { public MediaFormat getFormat() {
return mediaFormat; return mediaFormat;
} }
/**
* Gets the format id.
*
* @return the format id
*/
public int getFormatId() { public int getFormatId() {
return mediaFormat.id; return mediaFormat.id;
} }