Skip to content

Commit

Permalink
fix 'Download clip' button not showing (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
raymondben committed Nov 28, 2023
1 parent 5d050d0 commit cc4f5f2
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
Package: ovva
Title: A Shiny App for Volleyball Video Analysis
Version: 0.12.2
Version: 0.12.3
Authors@R: c(person(given = "Adrien", family = "Ickowicz", role = c("aut", "cre"), email = "[email protected]"),
person(given = "Ben", family = "Raymond", role = "aut"),
person("openvolley.org", role = "org"))
Description: A Shiny app and supporting functions for analysis of volleyball video and scouted match files.
URL: https://github.com/openvolley/ovva
URL: https://ovva.openvolley.org, https://github.com/openvolley/ovva
BugReports: https://github.com/openvolley/ovva/issues
License: MIT + file LICENSE
Encoding: UTF-8
Expand Down
13 changes: 9 additions & 4 deletions R/shiny_server.R
Original file line number Diff line number Diff line change
Expand Up @@ -970,16 +970,20 @@ ovva_shiny_server <- function(app_data) {
tags$button(tags$span(icon("expand", style = "vertical-align:middle;")), onclick = "dvpl.fullscreen();", title = "Full screen"),
tags$button(tags$span(icon("volume-mute", style = "vertical-align:middle;")), onclick = "dvpl.toggle_mute()", title = "Toggle mute")
),
tags$div(style="margin-top:10px;", tags$span(id = "subtitle", "Score"), tags$span(id = "subtitleskill", "Skill"),
uiOutput("create_clip_button_ui", inline = TRUE)))
tags$div(style="margin-top:10px;", tags$span(id = "subtitle", "Score"), tags$span(id = "subtitleskill", "Skill")))
})

clip_filename <- reactiveVal("")
clip_status <- reactiveVal(NULL)
output$create_clip_button_ui <- renderUI({
ok <- !is.null(playlist()) && nrow(playlist()) > 0 && !video_player_type() %in% c("youtube", "twitch")
## also check that videos are not remote
ok <- ok && !any(grepl("^https?://", playlist()$video_src, ignore.case = TRUE))
## also check that videos are not remote - exclude videos served by http[s], but not if they are being served by the local (ovva-initiated) server
temp_src <- playlist()$video_src
if (is.string(app_data$video_serve_method) && app_data$video_serve_method %in% c("lighttpd", "servr")) {
is_local_url <- substr(temp_src, 1, nchar(app_data$video_server_url)) == app_data$video_server_url
temp_src[which(is_local_url)] <- "" ## these are ok
}
ok <- ok && !any(grepl("^https?://", temp_src, ignore.case = TRUE))
if (ok) {
actionButton("create_clip_button", "Download clip")
} else {
Expand Down Expand Up @@ -1048,6 +1052,7 @@ ovva_shiny_server <- function(app_data) {
output$chart_ui <- renderUI({
out <- list(tags$div(style = "height:24px;"),
if (pl_can_be_saved()) downloadButton("download_playlist", label = "Download playlist CSV"),
uiOutput("create_clip_button_ui", inline = TRUE),
uiOutput("chart2_ui"))
do.call(tagList, Filter(Negate(is.null), out))
})
Expand Down

0 comments on commit cc4f5f2

Please sign in to comment.