diff --git a/platypush/backend/http/static/css/video.omxplayer.js b/platypush/backend/http/static/css/video.omxplayer.js new file mode 100644 index 000000000..694bc0c32 --- /dev/null +++ b/platypush/backend/http/static/css/video.omxplayer.js @@ -0,0 +1,9 @@ +#video-container { + max-width: 60em; + margin: 3em auto; +} + + #video-form input[type=text] { + width: 100%; + } + diff --git a/platypush/backend/http/static/js/video.omxplayer.js b/platypush/backend/http/static/js/video.omxplayer.js new file mode 100644 index 000000000..eeb7b6744 --- /dev/null +++ b/platypush/backend/http/static/js/video.omxplayer.js @@ -0,0 +1,43 @@ +$(document).ready(function() { + var $container = $('#video-container'), + $form = $('#video-form'); + + var initBindings = function() { + $form.on('submit', function(event) { + var formData = $(this).serializeArray().reduce(function(obj, item) { + var value = item.value.trim(); + if (value.length > 0) { + obj[item.name] = item.value; + } + + return obj; + }, {}); + + execute( + { + type: 'request', + action: 'video.omxplayer.stop', + }, + + function() { + execute( + { + type: 'request', + action: 'video.omxplayer.play', + args: formData, + } + ) + } + ); + + return false; + }); + }; + + var init = function() { + initBindings(); + }; + + init(); +}); + diff --git a/platypush/backend/http/templates/plugins/video.omxplayer.html b/platypush/backend/http/templates/plugins/video.omxplayer.html new file mode 100644 index 000000000..32dae5824 --- /dev/null +++ b/platypush/backend/http/templates/plugins/video.omxplayer.html @@ -0,0 +1,19 @@ + + + +