Skip to content

Commit

Permalink
#553 added AJAX to the video widget
Browse files Browse the repository at this point in the history
  • Loading branch information
stephanrauh committed Nov 26, 2016
1 parent ece2b69 commit 8babdf3
Show file tree
Hide file tree
Showing 5 changed files with 1,338 additions and 5 deletions.
33 changes: 31 additions & 2 deletions src/main/java/net/bootsfaces/component/video/Video.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,27 +18,42 @@

package net.bootsfaces.component.video;

import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.Map;

import javax.el.ValueExpression;
import javax.faces.component.FacesComponent;
import javax.faces.component.behavior.ClientBehaviorHolder;

import net.bootsfaces.component.ajax.IAJAXComponent;
import net.bootsfaces.listeners.AddResourcesListener;
import net.bootsfaces.render.Tooltip;
import net.bootsfaces.utils.BsfUtils;

/** This class holds the attributes of <b:video />. */
@FacesComponent("net.bootsfaces.component.video.Video")
public class Video extends VideoCore implements net.bootsfaces.render.IHasTooltip, net.bootsfaces.render.IResponsive {
public class Video extends VideoCore implements net.bootsfaces.render.IHasTooltip, net.bootsfaces.render.IResponsive,
IAJAXComponent, ClientBehaviorHolder {

public static final String COMPONENT_TYPE = "net.bootsfaces.component.video.Video";

public static final String COMPONENT_FAMILY = "net.bootsfaces.component";

public static final String DEFAULT_RENDERER = "net.bootsfaces.component.video.Video";

private static final Collection<String> EVENT_NAMES = Collections
.unmodifiableCollection(Arrays.asList("blur", "click", "dblclick", "focus", "input", "keydown", "keypress",
"keyup", "mousedown", "mousemove", "mouseout", "mouseover", "mouseup",
"abort", "canplay", "canplaythrough", "durationchange", "emptied",
"ended", "eeror", "loadeddata", "loadedmetadata", "loadstart",
"pause", "play", "playing", "progress", "ratechange", "seeked",
"seeking", "stalled", "suspend", "timeupdate", "volumechange", "waiting"));

public Video() {
Tooltip.addResourceFiles();
AddResourcesListener.addThemedCSSResource("core.css");
AddResourcesListener.addThemedCSSResource("bsf.css");
setRendererType(DEFAULT_RENDERER);
}

Expand All @@ -53,4 +68,18 @@ public void setValueExpression(String name, ValueExpression binding) {
name = BsfUtils.snakeCaseToCamelCase(name);
super.setValueExpression(name, binding);
}

@Override
public Map<String, String> getJQueryEvents() {
return null;
}

public Collection<String> getEventNames() {
return EVENT_NAMES;
}

public String getDefaultEventName() {
return "input";
}

}
Loading

0 comments on commit 8babdf3

Please sign in to comment.