can't play flv when redirect from struts using jaris flv player

411 Views Asked by At

I'm using Jaris flv player to play flv videos.

It can open the page and display normally when I directly open the page(http://mysite.com:8080/TSE/flv/player.jsp).

But if I redirect and open the page from struts action's return, it can not work(http://mysite.com:8080/TSE/multidocdetailDoc.action?selectId=C94DC060947048B188BB2FAF1804B0F3).

The page displays the alternative content (the case of no adobe flash).

What should I do?

flash-enabled content

alternative content

the action did nothing except redirect:

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>

the jsp is just like the example of jaris website:

<%@ 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

There are 0 best solutions below