ITeye博客

视频123

flyboNew · 2011-03-08 14:20 · 编程语言 · Flash · JavaScript · Markdown

在网上看了很多网页播放flv的视频啥的,研究了下,我在开发环境下这么玩出来的。 <% string path = "http://" + Request.Url.Host + ":" + Request.Url.Port; %>

评论(7)

  1. #7 楼 · flyboNew · 2011-06-15 10:18

    /**

    • 文 件 名: MyCallBack.java
    • 创 建 人: WebPortal项目组
    • 创建日期: 2010-10-02
    • 修 改 人:
    • 修改日期:
    • 备 注:

    */ package com.huawei.imsportal.soap;

    import org.apache.axis2.client.async.AxisCallback; import org.apache.axis2.context.MessageContext;

    public class MyCallBack implements AxisCallback {

    private String mystr="";
    
    
    public String getMystr() {
    	return mystr;
    }
    
    public void setMystr(String mystr) {
    	this.mystr = mystr;
    }
    
    public void onComplete() {
    	// TODO Auto-generated method stub
    	
    }
    
    public void onError(Exception arg0) {
    	// TODO Auto-generated method stub
    	
    }
    
    public void onFault(MessageContext arg0) {
    	// TODO Auto-generated method stub
    	
    }
    
    public void onMessage(MessageContext arg0) {
    	// TODO Auto-generated method stub
    	this.setMystr(arg0.getEnvelope().toString());
    }
    

    }

  2. #6 楼 · flyboNew · 2011-06-15 10:18

    /**

    • 文 件 名: InitSoap.java
    • 创 建 人: WebPortal项目组
    • 创建日期: 2010-10-02
    • 修 改 人:
    • 修改日期:
    • 备 注:

    */ package com.huawei.imsportal.soap;

    import org.apache.axis2.AxisFault; import org.apache.axis2.context.ConfigurationContext; import org.apache.axis2.context.ConfigurationContextFactory;

    import com.huawei.imsportal.business.SystemLoggerBusiness; import com.huawei.imsportal.business.impl.SystemLoggerBusinessImpl;

    public class InitSoap { private static InitSoap initSoap = null;

    public static ConfigurationContext configContext = null;
    
    private static final SystemLoggerBusiness logger = new SystemLoggerBusinessImpl();
    
    @SuppressWarnings( { "unchecked", "unused" })
    private static String getAddress()
    
    {
        
        Class theClass = SOAPOperation2.class;
        java.net.URL u = theClass.getResource("");
        
        //str会得到这个函数所在类的路径
        String str = u.toString();
        
        //截去一些前面6个无用的字符
        str = str.substring(6, str.length());
        
        //将%20换成空格(如果文件夹的名称带有空格的话,会在取得的字符串上变成%20)
        str = str.replaceAll("%20", " ");
        
        //查找“WEB-INF”在该字符串的位置
        int num = str.indexOf("WEB-INF");
        
        //截取即可
        str = str.substring(0, num + "WEB-INF".length());
        return str;
        
    }
    
    public static InitSoap getInstance()
    {
        if (initSoap == null)
        {
            initSoap = new InitSoap();
            init();
        }
        return initSoap;
    }
    
    public static void init()
    {
        try
        {
            if (configContext == null)
            {
                configContext = ConfigurationContextFactory
                        .createConfigurationContextFromFileSystem(null, null);
            }
        }
        catch (AxisFault e)
        {
            e.printStackTrace();
            logger.logger("error", "初始化configContext异常!", InitSoap.class
                    .getName()
                    + ".init()");
        }
    }
    

    }

  3. #5 楼 · flyboNew · 2011-06-15 10:17

    public String SendSoap(OMElement header, OMElement body, String spgUrl, String urn) { System.out.println(body.toString()); ServiceClient sender = null; try { InitSoap.getInstance(); ConfigurationContext configContext = InitSoap.configContext; //AxisConfiguration axisConfig = new AxisConfiguration(); //ConfigurationContext myConfigContext = new ConfigurationContext(axisConfig); Options options = new Options(); options.setTo(new EndpointReference(spgUrl)); sender = new ServiceClient(configContext, null); sender.setOptions(options); MyCallBack mcb = new MyCallBack(); sender.sendReceiveNonBlocking(body, mcb); int mytime = 0;

            //最大时间为 25925 设置超时时间为 25800 大约5秒
            while (mcb.getMystr().equals(""))
            {
                Thread.sleep(5);
                mytime = mytime + 5;
                if (mytime > 25800)
                {
                    sender.cleanupTransport();
                    sender.cleanup();
                    System.out.println("IACPortal SendSoap2 Connect TimeOut..."
                            + mytime);
                    return "Connect TimeOut..";
                }
                
            }
            sender.cleanupTransport();
            sender.cleanup();
            return mcb.getMystr();
        }
        catch (Exception axisFault)
        {
            axisFault.printStackTrace();
            String exmsg = axisFault.getMessage();
            try
            {
                if (null != sender)
                {
                    sender.cleanupTransport();
                    sender.cleanup();
                }
            }
            catch (AxisFault e)
            {
                e.printStackTrace();
            }
            logger
                    .logger(
                            "error",
                            "调用web service发生异常!",
                            SOAPOperation2.class.getName()
                                    + ".SendSoap(OMElement header, OMElement body, String spgUrl,String urn)");
            return exmsg;
        }
    
  4. #4 楼 · flyboNew · 2011-06-15 09:09
    <include file="struts-default.xml" />
    
    <package name="struts-interceptor" extends="struts-default">
    	<interceptors>
    		<interceptor name="authority"
    			class="com.huawei.imsportal.interceptor.AuthorityInterceptor" />
    
    		<interceptor name="entAuthority"
    			class="com.huawei.imsportal.interceptor.EntAuthorityInterceptor" />
    
    		<interceptor name="adminAuthority"
    			class="com.huawei.imsportal.interceptor.AdminAuthorityInterceptor" />
    
    		<interceptor name="language"
    			class="com.huawei.imsportal.interceptor.LanguageInterceptor" />
    
    		<interceptor-stack name="authorityStatic">
    			<interceptor-ref name="authority" />
    			<interceptor-ref name="defaultStack" />
    		</interceptor-stack>
    
    		<interceptor-stack name="entAuthorityStatic">
    			<interceptor-ref name="entAuthority" />
    			<interceptor-ref name="defaultStack" />
    		</interceptor-stack>
    		
    		<interceptor-stack name="adminAuthorityStatic">
    			<interceptor-ref name="adminAuthority" />
    			<interceptor-ref name="defaultStack" />
    		</interceptor-stack>
    		
    			<interceptor-stack name="luangugeStatic">
    			<interceptor-ref name="language" />
    			<interceptor-ref name="defaultStack" />
    		</interceptor-stack>
    	</interceptors>
    
    	<global-results>
    		<result name="login" type="redirectAction" >redirect</result>
    		<result name="entLogin" type="redirectAction">redirect-ent-login</result>
    		<result name="adminLogin" type="redirectAction">redirect-admin-login</result>
    	</global-results>
    </package>
    
  5. #3 楼 · flyboNew · 2011-06-15 09:07

    public OMElement getHeader(String impu) { OMElement oe = null; String section = SectionUtil.getSection(impu); IConfigService service = new ConfigServiceImpl(); Config config = service.getConfig(section); if(null == config) { config = service.getConfig("0"); } if (null != config) { this.spgUrl = config.getU_url(); this.spgNameSpace = config.getU_namespace();

            // 创建request SOAP包。
            OMFactory factory = OMAbstractFactory.getOMFactory();
            oe = factory.createOMElement(new QName("m"));
            OMNamespace ns = factory.createOMNamespace(config.getU_namespace(),
                    "m");
            OMElement h_auth = factory.createOMElement("Authentication", ns);
            OMElement h_uname = factory.createOMElement("Username", ns);
            h_uname.setText(config.getU_account());
            h_auth.addChild(h_uname);
            OMElement h_pass = factory.createOMElement("Password", ns);
            h_pass.setText(config.getU_password());
            h_auth.addChild(h_pass);
            // MEName值决定了数据包发送给哪台服务器,作为动态参数传递
            OMElement h_MEName = factory.createOMElement("MEName", ns);
            h_MEName.setText(config.getU_mename());
            OMElement h_msgId = factory.createOMElement("MessageID", ns);
            h_msgId.setText("1");
            oe.setNamespace(ns);
            oe.addChild(h_auth);
            oe.addChild(h_MEName);
            oe.addChild(h_msgId);
        }
        return oe;
    }
    
  6. #2 楼 · flyboNew · 2011-06-15 09:07

    @SuppressWarnings("unchecked") public OMElement getBody(Object obj, String osgNameSpace) {

        // 创建request SOAP包。
        XMLStreamReader reader = BeanUtil.getPullParser(obj);
        
        StreamWrapper parser = new StreamWrapper(reader);
        
        StAXOMBuilder staxOMBuilder = OMXMLBuilderFactory.createStAXOMBuilder(
                OMAbstractFactory.getOMFactory(), parser);
        
        OMElement element = staxOMBuilder.getDocumentElement();
        
        OMNamespace ns = OMAbstractFactory.getOMFactory().createOMNamespace(
                osgNameSpace, "m");
        
        element.setNamespace(ns);
        
        for (Iterator iterator = element.getChildElements(); iterator.hasNext();)
        {
            OMElement type = (OMElement) iterator.next();
            type.setNamespace(ns);
        }
        return element;
    }
    
  7. #1 楼 · flyboNew · 2011-03-08 14:24

    这个要下vcastr3.swf这个东东是播放器,LogoPlugIn.swf Logo控制器插件……javaScriptPlugIn.swf javaScript控制器插件啥暂停啊 拖放啊 啥的 反正是上面有个插件控制的 我忘记是啥插件了…… :oops:

评论功能维护中,当前仅展示历史评论。