diff --git a/guacamole/src/main/webapp/app/client/services/guacVideo.js b/guacamole/src/main/webapp/app/client/services/guacVideo.js index 4ed95d14f..26f07708a 100644 --- a/guacamole/src/main/webapp/app/client/services/guacVideo.js +++ b/guacamole/src/main/webapp/app/client/services/guacVideo.js @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014 Glyptodon LLC + * Copyright (C) 2015 Glyptodon LLC * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -30,47 +30,10 @@ angular.module('client').factory('guacVideo', [function guacVideo() { */ return new (function() { - var codecs = [ - 'video/ogg; codecs="theora, vorbis"', - 'video/mp4; codecs="avc1.4D401E, mp4a.40.5"', - 'video/webm; codecs="vp8.0, vorbis"' - ]; - - var probably_supported = []; - var maybe_supported = []; - /** - * Array of all supported video mimetypes, ordered by liklihood of - * working. + * Array of all supported video mimetypes. */ - this.supported = []; - - // Build array of supported audio formats - codecs.forEach(function(mimetype) { - - var video = document.createElement("video"); - var support_level = video.canPlayType(mimetype); - - // Trim semicolon and trailer - var semicolon = mimetype.indexOf(";"); - if (semicolon != -1) - mimetype = mimetype.substring(0, semicolon); - - // Partition by probably/maybe - if (support_level == "probably") - probably_supported.push(mimetype); - else if (support_level == "maybe") - maybe_supported.push(mimetype); - - }); - - // Add probably supported types first - Array.prototype.push.apply( - this.supported, probably_supported); - - // Prioritize "maybe" supported types second - Array.prototype.push.apply( - this.supported, maybe_supported); + this.supported = Guacamole.VideoPlayer.getSupportedTypes(); })();