mirror of
https://github.com/jwdeveloper/TikTokLiveJava.git
synced 2026-02-27 16:59:39 -05:00
Clarify Priority calling order
Altered pre-connection logic to make reason settable Optionally cancel connection if recorder is used and fails to find record url!
This commit is contained in:
@@ -63,12 +63,14 @@ public class RecorderListener implements LiveRecorder {
|
||||
|
||||
liveClient.getLogger().info("Searching for live download url");
|
||||
downloadData = settings.getPrepareDownloadData() != null ?
|
||||
settings.getPrepareDownloadData().apply(json) :
|
||||
mapToDownloadData(json);
|
||||
settings.getPrepareDownloadData().apply(json) :
|
||||
mapToDownloadData(json);
|
||||
|
||||
if (downloadData.getDownloadLiveUrl().isEmpty())
|
||||
liveClient.getLogger().warning("Unable to find download live url!");
|
||||
else
|
||||
if (downloadData.getDownloadLiveUrl().isEmpty()) {
|
||||
liveClient.getLogger().warning("Unable to find download live url!");
|
||||
if (settings.isCancelConnectionIfNotFound())
|
||||
event.setCancelConnection(true, "Unable to find download live url!");
|
||||
} else
|
||||
liveClient.getLogger().info("Live download url found!");
|
||||
}
|
||||
|
||||
|
||||
@@ -40,6 +40,10 @@ public class RecorderSettings {
|
||||
private File outputFile;
|
||||
private Function<String,DownloadData> prepareDownloadData;
|
||||
private boolean stopOnDisconnect = true;
|
||||
/**
|
||||
True to Cancel connection to live if the download url is not found
|
||||
*/
|
||||
private boolean cancelConnectionIfNotFound = false;
|
||||
|
||||
public static RecorderSettings DEFAULT() {
|
||||
return new RecorderSettings();
|
||||
|
||||
Reference in New Issue
Block a user