使用jaris flv player从struts重定向时无法播放flv

时间:2013-09-27 14:41:38

标签: java javascript struts2 flvplayer

我正在使用Jaris flv播放器播放flv视频。

当我直接打开页面(http://mysite.com:8080/TSE/flv/player.jsp)时,它可以打开页面并正常显示。

但是如果我从struts action的返回重定向并打开页面,则它无法正常工作(http://mysite.com:8080/TSE/multidocdetailDoc.action?selectId=C94DC060947048B188BB2FAF1804B0F3)

页面显示替代内容(没有adobe flash的情况)。

我该怎么办?

flash-enabled content

alternative content

除了重定向外,该操作没有做任何事情:

public String multidocdetail(){
        try {
            String selectId = getRequest().getParameter("selectId");
            System.out.println(selectId);
        } catch (Exception e) {
            // TODO: handle exception
            e.printStackTrace();
        }
        return "multidocDetail";
    }

struts:

<action name="*Doc" class="casco.com.tse.action.learn.DocAction" method="{1}">
            <result name="docDetail">/jsp/learn/docDetail.jsp</result>
            <result name="multidocDetail">/flv/player.jsp</result>
        </action>

jsp就像是jaris网站的例子:

<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
    <title>Jaris FLV Player</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="language" content="en" />
    <meta name="description" content="" />
    <meta name="keywords" content="" />

    <script type="text/javascript" src="js/swfobject.js"></script>
    <script type="text/javascript">
        var flashvarsVideo = {
            source: "http://localhost:8080/TSE/flv/mv/CTCS-3.flv",
            type: "video",
            streamtype: "file",
            server: "",//Used for rtmp streams
            duration: "52",
            poster: "http://localhost:8080/TSE/flv/poster.png",
            autostart: "false",
            logo: "http://localhost:8080/TSE/flv/logo.jpg",
            logoposition: "top left",
            logoalpha: "30",
            logowidth: "130",
            logolink: "http://jaris.sourceforge.net",
            hardwarescaling: "false",
            darkcolor: "000000",
            brightcolor: "4c4c4c",
            controlcolor: "FFFFFF",
            hovercolor: "67A8C1"
        };
        var params = {
            menu: "false",
            scale: "noScale",
            allowFullscreen: "true",
            allowScriptAccess: "always",
            bgcolor: "#000000",
            quality: "high",
            wmode: "opaque"
        };
        var attributes = {
            id:"JarisFLVPlayer"
        };
        //swfobject.embedSWF("JarisFLVPlayer.swf", "altContentOne", "576px", "360px", "10.0.0", "expressInstall.swf", flashvarsVideo, params, attributes);
        swfobject.embedSWF("JarisFLVPlayer.swf", "altContentOne", "750px", "520px", "10.0.0", "expressInstall.swf", flashvarsVideo, params, attributes);
    </script>
    <style>
        html, body { height:100%; }
        body { margin:0; }
    </style>
</head>
<body>
<br />
    <center>
    <h3>CTCS三级列控体系介绍</h3>
    <div id="altContentOne">
        <h1>Jaris FLV Player</h1>
        <p>Alternative content</p>
        <p><a href="http://www.adobe.com/go/getflashplayer"><img 
            src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" 
            alt="Get Adobe Flash player" /></a></p>
    </div>

    </center>
</body>
</html>

0 个答案:

没有答案