use of org.olat.modules.video.ui.VideoDisplayController in project openolat by klemens.
the class VideoOptionsForm method event.
@Override
protected void event(UserRequest ureq, Component source, Event event) {
if (source == chooseVideoButton || source == changeVideoButton) {
removeAsListenerAndDispose(searchController);
searchController = new ReferencableEntriesSearchController(getWindowControl(), ureq, new String[] { VideoFileResource.TYPE_NAME }, translate(NLS_COMMAND_CHOOSEVIDEO), true, false, false, false);
listenTo(searchController);
removeAsListenerAndDispose(cmc);
cmc = new CloseableModalController(getWindowControl(), translate("close"), searchController.getInitialComponent(), true, translate(NLS_COMMAND_CHOOSEVIDEO));
listenTo(cmc);
cmc.activate();
} else if (source == previewLink) {
VideoDisplayController previewController = null;
switch(config.getStringValue(VideoEditController.CONFIG_KEY_DESCRIPTION_SELECT)) {
case "resourceDescription":
previewController = new VideoDisplayController(ureq, getWindowControl(), repositoryEntry, config.getBooleanSafe(VideoEditController.CONFIG_KEY_AUTOPLAY), config.getBooleanSafe(VideoEditController.CONFIG_KEY_COMMENTS), config.getBooleanSafe(VideoEditController.CONFIG_KEY_RATING), true, "", false, false, "", true);
break;
case "customDescription":
previewController = new VideoDisplayController(ureq, getWindowControl(), repositoryEntry, config.getBooleanSafe(VideoEditController.CONFIG_KEY_AUTOPLAY), config.getBooleanSafe(VideoEditController.CONFIG_KEY_COMMENTS), config.getBooleanSafe(VideoEditController.CONFIG_KEY_RATING), true, "", true, false, config.getStringValue(VideoEditController.CONFIG_KEY_DESCRIPTION_CUSTOMTEXT), true);
break;
case "none":
previewController = new VideoDisplayController(ureq, getWindowControl(), repositoryEntry, config.getBooleanSafe(VideoEditController.CONFIG_KEY_AUTOPLAY), config.getBooleanSafe(VideoEditController.CONFIG_KEY_COMMENTS), config.getBooleanSafe(VideoEditController.CONFIG_KEY_RATING), true, "", true, false, "", true);
break;
}
cmc = new CloseableModalController(getWindowControl(), translate("close"), previewController.getInitialComponent(), true, translate(NLS_COMMAND_CHOOSEVIDEO));
listenTo(cmc);
cmc.activate();
}
}
use of org.olat.modules.video.ui.VideoDisplayController in project openolat by klemens.
the class VideoRunController method doLaunch.
private void doLaunch(UserRequest ureq) {
VelocityContainer myContent = createVelocityContainer("run");
if (videoRoot == null) {
RepositoryEntry re = VideoEditController.getVideoReference(config, false);
if (re == null) {
showError(VideoEditController.NLS_ERROR_VIDEOREPOENTRYMISSING);
return;
}
}
RepositoryEntry videoEntry = videoNode.getReferencedRepositoryEntry();
// configure the display controller according to config
boolean autoplay = config.getBooleanSafe(VideoEditController.CONFIG_KEY_AUTOPLAY);
boolean comments = config.getBooleanSafe(VideoEditController.CONFIG_KEY_COMMENTS);
boolean ratings = config.getBooleanSafe(VideoEditController.CONFIG_KEY_RATING);
String ident = videoNode.getIdent();
String customtext = config.getStringValue(VideoEditController.CONFIG_KEY_DESCRIPTION_CUSTOMTEXT);
switch(config.getStringValue(VideoEditController.CONFIG_KEY_DESCRIPTION_SELECT, "none")) {
case "resourceDescription":
videoDispCtr = new VideoDisplayController(ureq, getWindowControl(), videoEntry, autoplay, comments, ratings, true, ident, false, false, "", userCourseEnv.isCourseReadOnly());
break;
case "customDescription":
videoDispCtr = new VideoDisplayController(ureq, getWindowControl(), videoEntry, autoplay, comments, ratings, true, ident, true, false, customtext, userCourseEnv.isCourseReadOnly());
break;
case "none":
videoDispCtr = new VideoDisplayController(ureq, getWindowControl(), videoEntry, autoplay, comments, ratings, true, ident, true, false, "", userCourseEnv.isCourseReadOnly());
break;
}
listenTo(videoDispCtr);
myContent.put("videoDisplay", videoDispCtr.getInitialComponent());
main.setContent(myContent);
// Update launch counter
repositoryService.incrementLaunchCounter(videoEntry);
}
use of org.olat.modules.video.ui.VideoDisplayController in project OpenOLAT by OpenOLAT.
the class VideoOptionsForm method event.
@Override
protected void event(UserRequest ureq, Component source, Event event) {
if (source == chooseVideoButton || source == changeVideoButton) {
removeAsListenerAndDispose(searchController);
searchController = new ReferencableEntriesSearchController(getWindowControl(), ureq, new String[] { VideoFileResource.TYPE_NAME }, translate(NLS_COMMAND_CHOOSEVIDEO), true, false, false, false);
listenTo(searchController);
removeAsListenerAndDispose(cmc);
cmc = new CloseableModalController(getWindowControl(), translate("close"), searchController.getInitialComponent(), true, translate(NLS_COMMAND_CHOOSEVIDEO));
listenTo(cmc);
cmc.activate();
} else if (source == previewLink) {
VideoDisplayController previewController = null;
switch(config.getStringValue(VideoEditController.CONFIG_KEY_DESCRIPTION_SELECT)) {
case "resourceDescription":
previewController = new VideoDisplayController(ureq, getWindowControl(), repositoryEntry, config.getBooleanSafe(VideoEditController.CONFIG_KEY_AUTOPLAY), config.getBooleanSafe(VideoEditController.CONFIG_KEY_COMMENTS), config.getBooleanSafe(VideoEditController.CONFIG_KEY_RATING), true, "", false, false, "", true);
break;
case "customDescription":
previewController = new VideoDisplayController(ureq, getWindowControl(), repositoryEntry, config.getBooleanSafe(VideoEditController.CONFIG_KEY_AUTOPLAY), config.getBooleanSafe(VideoEditController.CONFIG_KEY_COMMENTS), config.getBooleanSafe(VideoEditController.CONFIG_KEY_RATING), true, "", true, false, config.getStringValue(VideoEditController.CONFIG_KEY_DESCRIPTION_CUSTOMTEXT), true);
break;
case "none":
previewController = new VideoDisplayController(ureq, getWindowControl(), repositoryEntry, config.getBooleanSafe(VideoEditController.CONFIG_KEY_AUTOPLAY), config.getBooleanSafe(VideoEditController.CONFIG_KEY_COMMENTS), config.getBooleanSafe(VideoEditController.CONFIG_KEY_RATING), true, "", true, false, "", true);
break;
}
cmc = new CloseableModalController(getWindowControl(), translate("close"), previewController.getInitialComponent(), true, translate(NLS_COMMAND_CHOOSEVIDEO));
listenTo(cmc);
cmc.activate();
}
}
use of org.olat.modules.video.ui.VideoDisplayController in project OpenOLAT by OpenOLAT.
the class VideoRunController method doLaunch.
private void doLaunch(UserRequest ureq) {
VelocityContainer myContent = createVelocityContainer("run");
if (videoRoot == null) {
RepositoryEntry re = VideoEditController.getVideoReference(config, false);
if (re == null) {
showError(VideoEditController.NLS_ERROR_VIDEOREPOENTRYMISSING);
return;
}
}
RepositoryEntry videoEntry = videoNode.getReferencedRepositoryEntry();
// configure the display controller according to config
boolean autoplay = config.getBooleanSafe(VideoEditController.CONFIG_KEY_AUTOPLAY);
boolean comments = config.getBooleanSafe(VideoEditController.CONFIG_KEY_COMMENTS);
boolean ratings = config.getBooleanSafe(VideoEditController.CONFIG_KEY_RATING);
String ident = videoNode.getIdent();
String customtext = config.getStringValue(VideoEditController.CONFIG_KEY_DESCRIPTION_CUSTOMTEXT);
switch(config.getStringValue(VideoEditController.CONFIG_KEY_DESCRIPTION_SELECT, "none")) {
case "resourceDescription":
videoDispCtr = new VideoDisplayController(ureq, getWindowControl(), videoEntry, autoplay, comments, ratings, true, ident, false, false, "", userCourseEnv.isCourseReadOnly());
break;
case "customDescription":
videoDispCtr = new VideoDisplayController(ureq, getWindowControl(), videoEntry, autoplay, comments, ratings, true, ident, true, false, customtext, userCourseEnv.isCourseReadOnly());
break;
case "none":
videoDispCtr = new VideoDisplayController(ureq, getWindowControl(), videoEntry, autoplay, comments, ratings, true, ident, true, false, "", userCourseEnv.isCourseReadOnly());
break;
}
listenTo(videoDispCtr);
myContent.put("videoDisplay", videoDispCtr.getInitialComponent());
main.setContent(myContent);
// Update launch counter
repositoryService.incrementLaunchCounter(videoEntry);
}
Aggregations