Package com.bramosystems.oss.player.util.client

Examples of com.bramosystems.oss.player.util.client.RegExp


     * @return <code>PluginVersion</code> object with specified version numbers.
     * @throws com.bramosystems.oss.player.util.client.RegExp.RegexException if {@code version} is not in the required format
     * @since 1.3
     */
    public static PluginVersion get(String version) throws RegexException {
        RegExp r = RegExp.getRegExp("(\\d+).(\\d+).(\\d+)", "");
        RegExp.RegexResult res = r.exec(version);
        return new PluginVersion(Integer.parseInt(res.getMatch(1)),
                Integer.parseInt(res.getMatch(2)),
                Integer.parseInt(res.getMatch(3)));
    }
View Full Code Here


     * @param mediaURL the mediaURL
     * @return the resulting absolute URL
     */
    public static String resolveMediaURL(String mediaURL) {
        RegExp.RegexResult rr = null;
        RegExp re = null;
        try {
            re = RegExp.getRegExp(GWT_HOST_URL_ID, "i");
            if (re.test(mediaURL)) {
                rr = re.exec(mediaURL);
                mediaURL = mediaURL.replaceAll(rr.getMatch(1), GWT.getHostPageBaseURL());
            }
           
            re = RegExp.getRegExp(GWT_MODULE_URL_ID, "i");
            if (re.test(mediaURL)) {
                rr = re.exec(mediaURL);
                mediaURL = mediaURL.replaceAll(rr.getMatch(1), GWT.getModuleBaseURL());
            }
        } catch (RegexException ex) {
        } finally {
            re = null;
View Full Code Here

        _height = height;
        _width = width;
        _autoplay = autoplay;
       
        try {
            RegExp re = RegExp.getRegExp("((\\w+):)?(\\w+)", "");
            RegExp.RegexResult rr = re.exec(name);
            _provider = rr.getMatch(2);
            if ((_provider == null) || (_provider.length() == 0)) {
                _provider = "core";
            }
            _playerName = rr.getMatch(3);
View Full Code Here

        public AbstractMediaPlayer getPlayer(String name, String url, boolean autoplay, String width,
                String height, HashMap<String, String> options) throws LoadException, PluginNotFoundException, PluginVersionException {

            String _provider = null, _pName = null;
            try {
                RegExp re = RegExp.getRegExp("((\\w+):)?(\\w+)", "");
                RegExp.RegexResult rr = re.exec(name);
                _provider = rr.getMatch(2);
                if ((_provider == null) || (_provider.length() == 0)) {
                    _provider = "api";
                }
                _pName = rr.getMatch(3);
View Full Code Here

        this.callback = callback;
    }
   
    private boolean isYouTubeURL(String url) {
        try {
            RegExp reg = RegExp.getRegExp(utubeRegex, "gi");
            return reg.test(url);
        } catch (RegexException ex) {
            return false;
        }
    }
View Full Code Here

            return false;
        }
    }
   
    private String getVideoId(String url) throws RegexException {
        RegExp reg = RegExp.getRegExp(utubeRegex, "gi");
        RegexResult rr = reg.exec(url);
        return rr.getMatch(2);
    }
View Full Code Here

TOP

Related Classes of com.bramosystems.oss.player.util.client.RegExp

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.