-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME.Rmd
85 lines (60 loc) · 4.49 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
# ovplayer
<!-- badges: start -->
[![lifecycle](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://www.tidyverse.org/lifecycle/#experimental)
![openvolley](https://img.shields.io/badge/openvolley-darkblue.svg?logo=data:image/svg%2bxml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMTAiIGhlaWdodD0iMjEwIj48cGF0aCBkPSJNOTcuODMzIDE4Ny45OTdjLTQuNTUtLjM5Ni0xMi44MTItMS44ODYtMTMuNTgxLTIuNDQ5LS4yNDItLjE3Ny0xLjY5Mi0uNzUzLTMuMjIyLTEuMjgxLTI4LjY5Ni05Ljg5NS0zNS4xNy00NS45ODctMTMuODY4LTc3LjMyMyAyLjY3Mi0zLjkzIDIuNTc5LTQuMTktMS4zOTQtMy45MDYtMTIuNjQxLjktMjcuMiA2Ljk1Mi0zMy4wNjYgMTMuNzQ1LTUuOTg0IDYuOTI3LTcuMzI3IDE0LjUwNy00LjA1MiAyMi44NjIuNzE2IDEuODI2LS45MTgtLjE3LTEuODktMi4zMS03LjM1Mi0xNi4xNzQtOS4xODEtMzguNTYtNC4zMzctNTMuMDc0LjY5MS0yLjA3IDEuNDE1LTMuODY2IDEuNjEtMy45ODkuMTk0LS4xMjMuNzgyLTEuMDUzIDE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4PSI5NC44NCIgcnk9IjkyLjU0MiIgZmlsbD0ibm9uZSIgc3Ryb2tlPSIjZmZmIiBzdHJva2Utd2lkdGg9IjEwLjc0Ii8+PC9zdmc+)
[![R build status](https://github.com/openvolley/ovplayer/workflows/R-CMD-check/badge.svg)](https://github.com/openvolley/ovplayer/actions)
<!-- badges: end -->
## Installation
You can install from [GitHub](https://github.com/openvolley/ovplayer) with:
```{r eval = FALSE}
## install.packages("remotes") ## if needed
remotes::install_github("openvolley/ovplayer")
```
## About
This R package provides a Shiny app for viewing volleyball video playlists.
At this stage it is entirely experimental. Beware!
## Example usage
```{r eval = FALSE}
library(ovplayer)
library(ovideo)
## read data file bundled with package
## this is a very small example file that contains only one rally
x <- datavolley::dv_read(system.file("extdata/190301_kats_beds-clip.dvw", package = "ovplayer"))
## change the video file to point to our local copy, which is bundled with the ovideo package
x$meta$video <- data.frame(camera = "",
file = system.file("extdata/2019_03_01-KATS-BEDS-clip.mp4", package = "ovideo"),
stringsAsFactors = FALSE)
## extract play-by-play data
px <- datavolley::plays(x)
## normally we would now filter px to the actions we are specifically interested in
## but here we just use all actions because the scout file is only from the one rally
## that the video covers
px <- px[!is.na(px$skill), ]
## make subtitle columns (shown just underneath the player)
px$subtitle <- px$player_name
px$subtitleskill <- ifelse(px$skill == "Attack", px$attack_code, px$skill)
## build our playlist of these actions
ply <- ov_video_playlist(px, x$meta, extra_cols = c("subtitle", "subtitleskill", "video_time", "code", "set_number", "home_team_score", "visiting_team_score"))
## start the shiny app
ovp_shiny(playlist = ply, video_server = "servr")
## Or the mobile version. This will be served from your laptop/desktop and can
## be viewed by a mobile device on the same (wifi) network
## You need to know the IP address of your laptop/desktop, we use "192.168.1.21" here
ovp_shiny(playlist = ply, mobile = TRUE, host = "192.168.1.21", video_server = "servr")
## and then go to "192.168.1.21:port" on your mobile to check it out (same wifi), where
## port is the port being used by the shiny app
```
And you should get something like:
<img src="man/figures/ovplayer.png" style="border: 1px solid black" />