diff --git a/Examples/WebContent/index.html b/Examples/WebContent/index.html
index 5c52342..cdd2e6d 100644
--- a/Examples/WebContent/index.html
+++ b/Examples/WebContent/index.html
@@ -79,6 +79,10 @@
Sample 1: Save to disk
fileUploadParams: {
id: 'my_editor'
},
+ videoUploadURL: '/upload_video',
+ videoUploadParams: {
+ id: 'my_editor'
+ },
imageManagerLoadURL: '/load_images',
imageManagerDeleteURL: "/delete_image",
imageManagerDeleteMethod: "POST"
@@ -121,6 +125,25 @@ Sample 1: Save to disk
console.log ('file delete problem: ' + JSON.stringify(err));
})
})
+ // Catch video removal from the editor.
+ .on('froalaEditor.video.removed', function (e, editor, $vid) {
+ $.ajax({
+ // Request method.
+ method: "POST",
+ // Request URL.
+ url: "/delete_video",
+ // Request params.
+ data: {
+ src: $vid.attr('src')
+ }
+ })
+ .done (function (data) {
+ console.log ('video was deleted');
+ })
+ .fail (function (err) {
+ console.log ('video delete problem: ' + JSON.stringify(err));
+ })
+ })
});
@@ -264,7 +287,8 @@ Sample 4: Save to Amazon using signature version 4
.done(function( data ) {
$('#edit-amazon').froalaEditor({
imageUploadToS3: data,
- fileUploadToS3: data
+ fileUploadToS3: data,
+ videoUploadToS3: data
})
});
});
diff --git a/Examples/build/classes/com/froala/examples/servlets/DeleteVideo.class b/Examples/build/classes/com/froala/examples/servlets/DeleteVideo.class
new file mode 100644
index 0000000..4d44c12
Binary files /dev/null and b/Examples/build/classes/com/froala/examples/servlets/DeleteVideo.class differ
diff --git a/Examples/build/classes/com/froala/examples/servlets/UploadVideo.class b/Examples/build/classes/com/froala/examples/servlets/UploadVideo.class
new file mode 100644
index 0000000..fccb9ec
Binary files /dev/null and b/Examples/build/classes/com/froala/examples/servlets/UploadVideo.class differ
diff --git a/Examples/src/com/froala/examples/servlets/DeleteVideo.java b/Examples/src/com/froala/examples/servlets/DeleteVideo.java
new file mode 100644
index 0000000..7bd5052
--- /dev/null
+++ b/Examples/src/com/froala/examples/servlets/DeleteVideo.java
@@ -0,0 +1,51 @@
+package com.froala.examples.servlets;
+
+import java.io.IOException;
+
+import javax.servlet.ServletException;
+import javax.servlet.annotation.WebServlet;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import com.froala.editor.Video;
+import com.google.gson.Gson;
+
+/**
+ * Servlet implementation class DeleteVideo
+ */
+@WebServlet("/delete_video")
+public class DeleteVideo extends HttpServlet {
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * @see HttpServlet#HttpServlet()
+ */
+ public DeleteVideo() {
+ super();
+ }
+
+ /**
+ * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse
+ * response)
+ */
+ @Override
+ protected void doPost(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+
+ String src = request.getParameter("src");
+
+ try {
+ Video.delete(request, src);
+ } catch (Exception e) {
+ e.printStackTrace();
+ response.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
+ return;
+ }
+ String jsonResponseData = new Gson().toJson("Success");
+ response.setContentType("application/json");
+ response.setCharacterEncoding("UTF-8");
+ response.getWriter().write(jsonResponseData);
+ }
+
+}
diff --git a/Examples/src/com/froala/examples/servlets/UploadImage.java b/Examples/src/com/froala/examples/servlets/UploadImage.java
index faac973..74a9176 100644
--- a/Examples/src/com/froala/examples/servlets/UploadImage.java
+++ b/Examples/src/com/froala/examples/servlets/UploadImage.java
@@ -49,10 +49,22 @@ protected void doPost(HttpServletRequest request, HttpServletResponse response)
responseData = new HashMap