Package com.bramosystems.oss.player.core.client

Examples of com.bramosystems.oss.player.core.client.PluginVersion


     */
    @UiConstructor
    public Flash(String mediaURL, String height, String width, String pluginVersion) {
        Widget w = null;
        try {
            PluginVersion version = new PluginVersion();
            try {
                RegExp.RegexResult res = RegExp.getRegExp("(\\d+).(\\d+).(\\d+)", "").exec(pluginVersion);
                version.setMajor(Integer.parseInt(res.getMatch(1)));
                version.setMinor(Integer.parseInt(res.getMatch(2)));
                version.setRevision(Integer.parseInt(res.getMatch(3)));
            } catch (RegexException ex) {
            }

            swf = new SWFWidget(Player.resolveMediaURL(mediaURL), width, height, version);
            w = swf;
View Full Code Here


        }
        if (sourceURL == null) {
            throw new NullPointerException("sourceURL cannot be null");
        }

        PluginVersion v = PlayerUtil.getFlashPlayerVersion();
        if (v.compareTo(minFlashVersion) < 0) {
            throw new PluginVersionException(Plugin.FlashPlayer, minFlashVersion.toString(), v.toString());
        }

        this.swfURL = sourceURL;
        this.width = width;
        this.height = height;
View Full Code Here

    protected static class PluginManagerImpl {

        public PluginInfo getPluginInfo(Plugin plugin) throws PluginNotFoundException {
            BrowserPlugin plug = null;
            PluginInfo.PlayerPluginWrapperType pwt = PluginInfo.PlayerPluginWrapperType.Native;
            PluginVersion pv = new PluginVersion();

            if (plugin.equals(Plugin.Native) || plugin.equals(Plugin.WinMediaPlayer)) {
                switch (plugin) {
                    case WinMediaPlayer:
                        boolean found = false;
                        MimeType mt = MimeType.getMimeType("application/x-ms-wmp");
                        if (mt != null) {   // firefox plugin present...
                            found = true;
                            pwt = PluginInfo.PlayerPluginWrapperType.WMPForFirefox;
                        } else {   // firefox plugin not found check for generic..
                            mt = MimeType.getMimeType("application/x-mplayer2");
                            if (mt != null) {
                                try {
                                    plug = mt.getEnabledPlugin(); // who's got the mime ? (WMP / VLC)
                                    if (plug.getName().contains("Windows Media Player")) {
                                        found = true;
                                    }
                                } catch (PluginNotFoundException ex) {
                                }
                            }
                        }

                        if (found) {
                            updateWMPVersion(pv);
                            plug = mt.getEnabledPlugin();
                            if (plug.getFileName().toLowerCase().contains("totem")
                                    || plug.getDescription().toLowerCase().contains("totem")) {
                                pwt = PluginInfo.PlayerPluginWrapperType.Totem;
                            }
                        } else {
                            throw new PluginNotFoundException(plugin);
                        }
                        break;
                    case Native:
                        if (isHTML5CompliantClient()) {
                            pv = PluginVersion.get(5, 0, 0);
                        } else {
                            throw new PluginNotFoundException(plugin);
                        }
                }
                return new PluginInfo(plugin, pv, pwt);
            }

            PluginMimeTypes pt = PluginMimeTypes.none;
            switch (plugin) {
                case DivXPlayer:
                    pt = PluginMimeTypes.divx;
                    break;
                case FlashPlayer:
                    pt = PluginMimeTypes.flash;
                    break;
                case QuickTimePlayer:
                    pt = PluginMimeTypes.quicktime;
                    break;
                case VLCPlayer:
                    pt = PluginMimeTypes.vlc;
                    break;
            }

            MimeType mt = MimeType.getMimeType(pt.mime);
            if (mt != null) {   // plugin present...
                try {
                    String desc = mt.getEnabledPlugin().getDescription();
                    String name = mt.getEnabledPlugin().getName();
                    if (name.toLowerCase().contains(pt.whois)) { // who has it?
                        RegExp.RegexResult res = RegExp.getRegExp(pt.regex, "").exec(pt.versionInName ? name : desc);
                        pv = new PluginVersion(Integer.parseInt(res.getMatch(1)),
                                Integer.parseInt(res.getMatch(2)), res.getMatch(3) != null ? Integer.parseInt(res.getMatch(4)) : 0);
                        if (mt.getEnabledPlugin().getFileName().toLowerCase().contains("totem")
                                || desc.toLowerCase().contains("totem")) {
                            pwt = PluginInfo.PlayerPluginWrapperType.Totem;
                        }
View Full Code Here

        } catch (e) {}
        }-*/;

        @Override
        public PluginInfo getPluginInfo(Plugin plugin) throws PluginNotFoundException {
            PluginVersion pv = new PluginVersion();
            switch (plugin) {
                case DivXPlayer:
                    getDivXPluginVersion(pv);
                    break;
                case FlashPlayer:
                    getFlashPluginVersion(pv);
                    break;
                case QuickTimePlayer:
                    getQuickTimePluginVersion(pv);
                    break;
                case VLCPlayer:
                    getVLCPluginVersion(pv);
                    break;
                case WinMediaPlayer:
                    getWindowsMediaPlayerVersion(pv);
                    break;
                case Native:
                    if (isHTML5CompliantClient()) {
                        pv = PluginVersion.get(5, 0, 0);
                    }
            }
            if (pv.compareTo(new PluginVersion()) <= 0) {
                throw new PluginNotFoundException(plugin);
            }
            return new PluginInfo(plugin, pv, PluginInfo.PlayerPluginWrapperType.Native);
        }
View Full Code Here

     * {@code width} is null
     */
    public YouTubePlayer(String videoID, String width, String height)
            throws PluginNotFoundException, PluginVersionException {
        super(videoID, width, height, false);
        PluginVersion det = getProvider().getDetectedPluginVersion("YouTube");
        PluginVersion req = PluginVersion.get(10, 1, 0);
        if (det.compareTo(req) < 0) {
            throw new PluginVersionException(req.toString(), det.toString());
        }
        initWidget(new SimplePanel());

        // register for DOM events ...
        getProvider().initHandler(playerId, false, new DefaultEventHandler() {
View Full Code Here

TOP

Related Classes of com.bramosystems.oss.player.core.client.PluginVersion

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.