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