0 Replies Latest reply on Jul 23, 2009 4:45 AM by sinek vale

    An image changing to FLV Video Player in AJAX Update Panel

    sinek vale

      Hi,

      I'm trying to design part of a website can seen as video gallery. I have videos related to subcategories; and subcategories that related to categories.

      I was using popups but now want to change it. Simply, firstly there are images and descriptions(in an update panel) of videos on page. After clicking thumbnail, the region includes thumbnail and description wil be changed to FLV video player.

      Outside of updatepanel player is working good. but when i move it into updatepanel; doesn't working in IE. Because JS code (AC_FL_RunContent(.....)) is not working in updatepanel. Tried another script (like alert('hello!');), it's working. I think i have problem with the function named AC_FL_RunContent(...). It's working as i want, if open page with Firefox.

      Looked for this in google. Visited many pages, but never find a solution for this nor source of problem. I hope someone can help me

      Using ASP.Net. I'm attaching my tree structure and codes below:

       

      trees.JPG

      Default.aspx

       

       

       

       

       

      <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default"%>

       

      <!

       

      DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" //www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

       

      <

       

      html xmlns ="http://www.w3.org/1999/xhtml">

       

      <

       

      head id="Head1" runat="server">

       

       

       

       

       

       

      <title>Untitled Page</title>

       

       

       

       

      <link href="StyleSheet.css" rel="stylesheet" type="text/css"/>

       

       

       

       

      <script type ="text/javascript">

      function

       

      MM_CheckFlashVersion(reqVerStr,msg){

        with (navigator){

            var isIE = (appVersion.indexOf("MSIE") != -1 && userAgent.indexOf("Opera") == -1);

            var isWin = (appVersion.toLowerCase().indexOf("win") != -1);

            if (!isIE || !isWin){

              var flashVer = -1;

              if (plugins && plugins.length > 0){

                  var desc = plugins["Shockwave Flash"] ? plugins["Shockwave Flash"].description : "";

                  desc = plugins["Shockwave Flash 2.0"] ? plugins["Shockwave Flash 2.0"].description : desc;

                  if (desc == "") flashVer = -1;

                  else{

                    var descArr = desc.split(" ");

                    var tempArrMajor = descArr[2].split(".");

                    var verMajor = tempArrMajor[0];

                    var tempArrMinor = (descArr[3] != "") ? descArr[3].split("r") : descArr[4].split("r");

                    var verMinor = (tempArrMinor[1] > 0) ? tempArrMinor[1] : 0;

                    flashVer = parseFloat(verMajor + "." + verMinor);

       

       

                  }

              }

              // WebTV has Flash Player 4 or lower -- too low for video

              else if (userAgent.toLowerCase().indexOf("webtv") != -1) flashVer = 4.0;

              var verArr = reqVerStr.split(",");

              var reqVer = parseFloat(verArr[0] + "." + verArr[2]);

              if (flashVer < reqVer){

                  if(confirm(msg))

                    window.location = http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash;

       

       

              }

            }

        }

      }

      function

       

      callFLVP(){

       

       

        AC_FL_RunContent('codebase','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0','width','320','height','240','id','FLVPlayer','src','FLVPlayer_Progressive','flashvars','&MM_ComponentVersion=1&skinName=Clear_Skin_1&streamName=./VideoGallery/serpende&autoPlay= false&autoRewind=false','quality','high','scale','noscale','name','FLVPlayer','salign','lt','pluginspage','http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash','movie','FLVPlayer_Progressive');

       

       

      }

      </

       

      script>

       

      <

       

      script src="Scripts/AC_RunActiveContent.js" type="text/javascript"></script>

       

       

      </

       

      head>

      <body onload="MM_CheckFlashVersion('7,0,0,0','Content on this page requires a newer version of Adobe Flash Player. Do you want to download it now?');">

        <form id="form1" runat="server">

            <ajaxToolkit:ToolkitScriptManager ID="ScriptManager1" runat="server" />

            <div>

              <asp:UpdatePanel ID="UpdatePanel1" runat="server">

              <ContentTemplate>

                  <asp:Literal ID="thumbLiteral" runat="server"></asp:Literal>

              </ContentTemplate>

              <Triggers>

                  <asp:AsyncPostBackTrigger ControlID="showvideoButton" EventName="Click" />

              </Triggers>

              </asp:UpdatePanel>

              <asp:Button ID="showvideoButton" Text="Video" runat="server" onclick="showButton_Click"/>

       

       

       

       

       

       

           </div>

       

       

         </form>

       

      </

       

      body>

       

      </

       

      html>

       

      Default.aspx.cs

       

       

      public partial class _Default : System.Web.UI.Page

      {

           protected void Page_Load(object sender, EventArgs e)

           {

                thumbLiteral.Text = "<img src id=\"imgThumb\" src=\"./VideoGallery/small/serpende.jpg\" />";

       

           }

       

           protected void showButton_Click(object sender, EventArgs e)

           {

                string strNoScriptBlock = "";

                strNoScriptBlock += "<noscript>";

                strNoScriptBlock += "<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0\" width=\"320\" height=\"240\" id=\"Object1\"><param name=\"movie\" value=\"FLVPlayer_Progressive.swf\" /><param name=\"salign\" value=\"lt\" /><param name=\"quality\" value=\"high\" /><param name=\"scale\" value=\"noscale\" /><param name=\"FlashVars\" value=\"&MM_ComponentVersion=1&skinName=Clear_Skin_1&streamName=serpende&autoPlay=false&a utoRewind=false\" /><embed src=\"FLVPlayer_Progressive.swf\" flashvars=\"&MM_ComponentVersion=1&skinName=Clear_Skin_1&streamName=serpende&autoPlay=fal se&autoRewind=false\" quality=\"high\" scale=\"noscale\" width=\"320\" height=\"240\" name=\"FLVPlayer\" salign=\"LT\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash\" /></object>";

           strNoScriptBlock += "</noscript>";

       

           string strScriptBlock = "";

           strScriptBlock += "<script>";

           strScriptBlock += "callFLVP();";

           strScriptBlock += "</script>";

       

           ScriptManager.RegisterClientScriptBlock(this, typeof(string), "strScriptBlock", strScriptBlock, false);

           thumbLiteral.Text = strNoScriptBlock;

      }

      }