mirror of https://github.com/FongMi/TV.git
parent
655a73f5b2
commit
7eb98d5347
@ -0,0 +1,39 @@ |
||||
package com.fongmi.android.tv.bean; |
||||
|
||||
import android.net.Uri; |
||||
import android.text.TextUtils; |
||||
|
||||
import com.google.android.exoplayer2.MediaItem; |
||||
import com.google.gson.annotations.SerializedName; |
||||
|
||||
public class Sub { |
||||
|
||||
@SerializedName("url") |
||||
private String url; |
||||
@SerializedName("name") |
||||
private String name; |
||||
@SerializedName("lang") |
||||
private String lang; |
||||
@SerializedName("format") |
||||
private String format; |
||||
|
||||
public String getUrl() { |
||||
return TextUtils.isEmpty(url) ? "" : url; |
||||
} |
||||
|
||||
public String getName() { |
||||
return TextUtils.isEmpty(name) ? "" : name; |
||||
} |
||||
|
||||
public String getLang() { |
||||
return TextUtils.isEmpty(lang) ? "zh" : lang; |
||||
} |
||||
|
||||
public String getFormat() { |
||||
return TextUtils.isEmpty(format) ? "" : format; |
||||
} |
||||
|
||||
public MediaItem.SubtitleConfiguration getExoSub() { |
||||
return new MediaItem.SubtitleConfiguration.Builder(Uri.parse(getUrl())).setLabel(getName()).setMimeType(getFormat()).setLanguage(getLang()).build(); |
||||
} |
||||
} |
||||
Loading…
Reference in new issue