View source: R/search_openresult_inquicktime.R
search_openresult_inquicktime | R Documentation |
The function remote controls 'Quicktime' by using an Apple Script. It opens a search result in 'Quicktime' and plays it.
search_openresult_inquicktime( x, s, resultNr, play = TRUE, closeAfterPlaying = FALSE, bringQuicktimeToFront = TRUE, filterFile = c(".*\\.(mp4|mov)", ".*\\.(aiff|aif|wav)", ".*\\.mp3") )
x |
Corpus object. |
s |
Search object. |
resultNr |
Integer; Number of the search result (row in the data frame |
play |
Logical; If |
closeAfterPlaying |
Logical; if |
bringQuicktimeToFront |
Logical; if |
filterFile |
Vector of character strings; Each element of the vector is a regular expression. Expressions will be checked consecutively. The first match with an existing media file will be used for playing. The default checking order is video > uncompressed audio > compressed audio. |
Note: You need to be on a Mac to use this function.
Span
If you want to extend the cut before or after each search result, you can modify @cuts.span.beforesec
and @cuts.span.aftersec
in your search object.
Logical; TRUE
if media file has been played, or FALSE
if not.
library(act) mysearch <- act::search_new(x=examplecorpus, pattern = "pero") # You can only use this function if you are on a Mac. # In addition, you need to have downloaded the example media. ## Not run: # Assign media files examplecorpus@paths.media.files <- c("FOLDERWHEREMEDIAFILESARELOCATED") examplecorpus <- act::media_assign(examplecorpus) # Play the media for the first search result act::search_openresult_inquicktime(x=examplecorpus, s=mysearch, resultNr = 1, play=TRUE, closeAfterPlaying=TRUE) # Play all search results after one another. for (i in 1:nrow(mysearch@results)) { print(mysearch@results$content[i]) act::search_openresult_inquicktime(x=examplecorpus, s=mysearch, resultNr = i, play=TRUE, closeAfterPlaying=TRUE) } ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.