knitr::opts_chunk$set( collapse = TRUE, comment = "#>" ) library(knitr)
This vignette describes how to get started using the opencastR package.
In order to use the opencastR package the hostname of your Opencast server, your username and password need to be set as environment variables. For this example I use the Legacy Opencast Testserver and the default credentials.
library(opencastR) Sys.setenv(OPENCAST_HOST = "https://legacy.opencast.org") Sys.setenv(OPENCAST_USERNAME = "admin") Sys.setenv(OPENCAST_PASSWORD = "opencast")
To check if everything is setup correctly the oc_api function can be used which returns the default api version and the server url.
oc_api()
The return of this functions shows that a list of the class opencast_api has been returned. This list contains three elements. The content, the url that was called and the full response. So access only the content we can do the following.
api_test <- oc_api() api_test$content
To showcase a more useful functions a list of events on the testserver can be retrieved.
events <- oc_list_events() kable(events$content)
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.