add animated gif support

This commit is contained in:
hat3ph
2023-12-06 06:54:20 +08:00
committed by GitHub
parent 2d0b631e73
commit 13c36ba741
2 changed files with 32 additions and 4 deletions

View File

@@ -49,6 +49,14 @@ Rectangle {
fillMode: Image.PreserveAspectCrop
}
// Set Animated GIF Background Image
AnimatedImage {
id: animatedGIF1
anchors.fill: parent
//source: "mepwyd8.gif"
fillMode: AnimatedImage.PreserveAspectCrop
}
// Set Background Video1
MediaPlayer {
id: mediaplayer1
@@ -510,11 +518,31 @@ Rectangle {
if ( time >= config.day_time_start && time <= config.day_time_end ) {
playlist1.load(Qt.resolvedUrl(config.background_vid_day), 'm3u')
playlist2.load(Qt.resolvedUrl(config.background_vid_day), 'm3u')
image1.source = config.background_img_day
//image1.source = config.background_img_day
if ( config.backgroud_img_day !== null ) {
//image1.source = config.background_img_day
var fileType = config.background_img_day.substring(config.background_img_day.lastIndexOf(".") + 1)
console.log(fileType)
if (fileType === "gif") {
animatedGIF1.source = config.background_img_day
} else {
image1.source = config.background_img_day
}
}
} else {
playlist1.load(Qt.resolvedUrl(config.background_vid_night), 'm3u')
playlist2.load(Qt.resolvedUrl(config.background_vid_night), 'm3u')
image1.source = config.background_img_night
//image1.source = config.background_img_night
if ( config.backgroud_img_night !== null ) {
//image1.source = config.background_img_night
var fileType = config.background_img_night.substring(config.background_img_night.lastIndexOf(".") + 1)
console.log(fileType)
if (fileType === "gif") {
animatedGIF1.source = config.background_img_night
} else {
image1.source = config.background_img_night
}
}
}
for (var k = 0; k < Math.ceil(Math.random() * 10) ; k++) {

View File

@@ -2,7 +2,7 @@
SDDM theme with Apple TV Aerial videos
Videos are played randomly and diferent playlists are used based on time of day (only day and night diferenciation, night between 5pm - 5am) its possible to tweak to have more time diferentiation, the one used is provided with the videos.
Videos are played randomly and different playlists are used based on time of day (only day and night diferenciation, night between 5pm - 5am) its possible to tweak to have more time diferentiation, the one used is provided with the videos.
### Dependencies
@@ -58,7 +58,7 @@ done < playlist_file
You can change a few settings in this file
- `day_time_start` and `day_time_end` - set your day start/end time
- `background_img_day` and `background_img_night` - default background day/night image
- `background_img_day` and `background_img_night` - default background day/night image, now support GIF animated image
- `background_vid_day` and `background_vid_night` - video playlists
- `displayFont` - font
- `showLoginButton` - if set to false will hide the login button