Pues ahora hay doble buffer
Falta el hilo que descargue el video de youtube, que se dice mas pronto que se hace
This commit is contained in:
57
ui/main.qml
57
ui/main.qml
@@ -14,7 +14,8 @@ Window {
|
||||
color: "#1e1e2e"
|
||||
|
||||
function togglePause() {
|
||||
videoPlayer.playbackState == MediaPlayer.PlayingState ? videoPlayer.pause() : videoPlayer.play();
|
||||
// videoPlayer.playbackState == MediaPlayer.PlayingState ? videoPlayer.pause() : videoPlayer.play();
|
||||
playlist.togglePause();
|
||||
|
||||
seekFeedback.hide();
|
||||
playFeedback.trigger();
|
||||
@@ -38,7 +39,8 @@ Window {
|
||||
}
|
||||
dir = 1;
|
||||
|
||||
videoPlayer.position = Math.min(videoPlayer.duration, videoPlayer.position + time);
|
||||
// videoPlayer.position = Math.min(videoPlayer.duration, videoPlayer.position + time);
|
||||
playlist.seek(time);
|
||||
innerText.text = "+" + (5 * window.times);
|
||||
} else if (time <= 0) {
|
||||
if (dir > 0) {
|
||||
@@ -46,7 +48,8 @@ Window {
|
||||
}
|
||||
dir = -1;
|
||||
|
||||
videoPlayer.position = Math.max(0, videoPlayer.position + time);
|
||||
// videoPlayer.position = Math.max(0, videoPlayer.position + time);
|
||||
playlist.seek(time);
|
||||
innerText.text = "-" + (5 * window.times);
|
||||
}
|
||||
|
||||
@@ -83,31 +86,34 @@ Window {
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
}
|
||||
|
||||
// Estudiar el doble buffer, parece ser no tan coñazo como podria esperar
|
||||
// mañana lo intento implementar
|
||||
Video {
|
||||
id: videoPlayer
|
||||
AudioOutput {
|
||||
id: audioOutputA
|
||||
}
|
||||
|
||||
VideoOutput {
|
||||
id: displayOutputA
|
||||
anchors.fill: parent
|
||||
anchors.centerIn: parent
|
||||
source: playlist.currentVideoSource
|
||||
visible: true
|
||||
loops: 0
|
||||
playbackRate: 1
|
||||
}
|
||||
|
||||
onSourceChanged: {
|
||||
console.log("Now playing:", source);
|
||||
if (source.toString() !== "") {
|
||||
videoPlayer.play();
|
||||
}
|
||||
}
|
||||
AudioOutput {
|
||||
id: audioOutputB
|
||||
}
|
||||
|
||||
onStopped: {
|
||||
playlist.loadNextVideo();
|
||||
}
|
||||
VideoOutput {
|
||||
id: displayOutputB
|
||||
anchors.fill: parent
|
||||
}
|
||||
|
||||
onVisibleChanged: {
|
||||
console.log("Cambio la visibilidad");
|
||||
}
|
||||
Component.onCompleted: {
|
||||
playlist.videoOutputA = displayOutputA;
|
||||
playlist.audioOutputA = audioOutputA;
|
||||
|
||||
playlist.videoOutputB = displayOutputB;
|
||||
playlist.audioOutputB = audioOutputB;
|
||||
|
||||
playlist.addToQueue("../ui/media/video.mp4");
|
||||
playlist.addToQueue("../ui/media/Puta.mp4");
|
||||
playlist.swapAndPlay();
|
||||
}
|
||||
|
||||
FadingFeedback {
|
||||
@@ -117,7 +123,8 @@ Window {
|
||||
id: innerIcon
|
||||
anchors.centerIn: parent
|
||||
anchors.fill: parent
|
||||
source: videoPlayer.playbackState === MediaPlayer.PlayingState ? "qrc:/App/ui/icons/play.svg" : "qrc:/App/ui/icons/pause.svg"
|
||||
// source: videoPlayer.playbackState === MediaPlayer.PlayingState ? "qrc:/App/ui/icons/play.svg" : "qrc:/App/ui/icons/pause.svg"
|
||||
source: playlist.playingState === "playing" ? "qrc:/App/ui/icons/play.svg" : "qrc:/App/ui/icons/pause.svg"
|
||||
color: "white"
|
||||
fillMode: Image.PreserveAspectFit
|
||||
|
||||
|
||||
Reference in New Issue
Block a user