forked from j62/ctbrec
Make log messages less serious for player errors
This commit is contained in:
parent
6ab70dd5df
commit
3188511c6a
|
@ -14,6 +14,7 @@ import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
import ctbrec.Config;
|
import ctbrec.Config;
|
||||||
|
import ctbrec.io.HttpException;
|
||||||
import ctbrec.recorder.download.StreamSource;
|
import ctbrec.recorder.download.StreamSource;
|
||||||
import javafx.application.Platform;
|
import javafx.application.Platform;
|
||||||
import javafx.event.EventHandler;
|
import javafx.event.EventHandler;
|
||||||
|
@ -199,11 +200,11 @@ public class PreviewPopupHandler implements EventHandler<MouseEvent> {
|
||||||
double aspect = (double)video.getWidth() / video.getHeight();
|
double aspect = (double)video.getWidth() / video.getHeight();
|
||||||
double w = Config.getInstance().getSettings().thumbWidth;
|
double w = Config.getInstance().getSettings().thumbWidth;
|
||||||
double h = w / aspect;
|
double h = w / aspect;
|
||||||
|
progressIndicator.setVisible(false);
|
||||||
videoPreview.setVisible(true);
|
videoPreview.setVisible(true);
|
||||||
videoPreview.setMediaPlayer(videoPlayer);
|
videoPreview.setMediaPlayer(videoPlayer);
|
||||||
resize(w, h);
|
resize(w, h);
|
||||||
videoPlayer.play();
|
videoPlayer.play();
|
||||||
progressIndicator.setVisible(false);
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -212,7 +213,12 @@ public class PreviewPopupHandler implements EventHandler<MouseEvent> {
|
||||||
if(e.getMessage().equals("Stream url unknown")) {
|
if(e.getMessage().equals("Stream url unknown")) {
|
||||||
// fine hls url for mfc not known yet
|
// fine hls url for mfc not known yet
|
||||||
} else {
|
} else {
|
||||||
LOG.error("Couldn't start preview video", e);
|
LOG.warn("Couldn't start preview video: {}", e.getMessage());
|
||||||
|
}
|
||||||
|
showTestImage();
|
||||||
|
} catch (HttpException e) {
|
||||||
|
if(e.getResponseCode() != 404) {
|
||||||
|
LOG.warn("Couldn't start preview video: {}", e.getMessage());
|
||||||
}
|
}
|
||||||
showTestImage();
|
showTestImage();
|
||||||
} catch (InterruptedException | InterruptedIOException e) {
|
} catch (InterruptedException | InterruptedIOException e) {
|
||||||
|
@ -221,11 +227,11 @@ public class PreviewPopupHandler implements EventHandler<MouseEvent> {
|
||||||
if(e.getCause() instanceof InterruptedException || e.getCause() instanceof InterruptedIOException) {
|
if(e.getCause() instanceof InterruptedException || e.getCause() instanceof InterruptedIOException) {
|
||||||
// future has been canceled, that's fine
|
// future has been canceled, that's fine
|
||||||
} else {
|
} else {
|
||||||
LOG.error("Couldn't start preview video", e);
|
LOG.warn("Couldn't start preview video: {}", e.getMessage());
|
||||||
showTestImage();
|
showTestImage();
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
LOG.error("Couldn't start preview video", e);
|
LOG.warn("Couldn't start preview video: {}", e.getMessage());
|
||||||
showTestImage();
|
showTestImage();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue