Just that.

I use asp.net and the ajax control tool kit.


I want my video to be playing inside a modal dialog box created by
the
modalpopup extender.
I tried initializing the swfobject before the modal popup is visible
and it does not work.


I want for the user to be able to click on a video link and the modal
popup to popup and play the video. So I use the same popup every time
and I use the javascript API of the swfobject to play diferent videos
etc...


but... :


1st it seems that there is problem initialising the swfobject when
the
popup is hiden. in other words I need to display the popup first and
then initialize it like this otherwise it does not call the
'onYouTubePlayerReady' function defined on the page:

$find(this._MPEYTPlayerViewerPopupID).show();      //pop the dialog
box
var params = { allowScriptAccess: "always", bgcolor: "#cccccc" };
                  var atts = { id: "myytplayer" };
            swfobject.embedSWF("http://www.youtube.com/apiplayer?
enablejsapi=1&playerapiid=ytplayer", this._ytapiplayerPanID, "400",
"300", "8", null, null, params, atts);   //initialise the SWFobject


2nd it seems something hapens to the swfobject after playing a video
when you then go and close the popup (hiding it) in firefox so that
it will not then replay another video when clicking another link (it
refeshes the entire page)


$find(this._MPEYTPlayerViewerPopupID).hide();
 $find(this._MPEYTPlayerViewerPopupID).show();     //pop the dialog
box
ytplayer.loadVideoById(this._VideoIDToView, parseInt('0'));     //
play
the video


(this does not work in fire fox it refreshes the page)


3rd it seems there is no way to destroy the swfobject to then
reinitialize it


 if (ytplayer) {
            ytplayer.stopVideo();
            ytplayer.clearVideo();
             // ytplayer = null;
        }
    $find(this._MPEYTPlayerViewerPopupID).hide();    //hide the popup
$find(this._MPEYTPlayerViewerPopupID).show();      //pop the dialog
box

            var params = { allowScriptAccess: "always", bgcolor:
"#cccccc" };
              var atts = { id: "myytplayer" };
            swfobject.embedSWF("http://www.youtube.com/apiplayer?
enablejsapi=1&playerapiid=ytplayer", this._ytapiplayerPanID, "400",
"300", "8", null, null, params, atts);


something like that would be nice... is there anything like that?


this is my control:


<asp:HyperLink ID="hiddenpopupbutton" runat="server" Text="Button"
Style="display: none" ></asp:HyperLink>


<script language="javascript" type="text/javascript">
    var ytplayer;
    function updateHTML(elmId, value) {
        document.getElementById(elmId).innerHTML = value;
    }
    function onYouTubePlayerReady(playerId) {
       alert('reade')
        ytplayer = document.getElementById("myytplayer");
        //ytplayer2 = document.getElementById("BCWwweytplayerID");
        $find('AlbumYTPLayer').YTPlayerIsReady(playerId, ytplayer);


    }


    function setytplayerState(newState) {
        updateHTML("playerstate", newState);
    }


      function onytplayerStateChange(newState) {
        setytplayerState(newState);
    }


    function updateytplayerInfo() {
        updateHTML("bytesloaded", getBytesLoaded());
        updateHTML("bytestotal", getBytesTotal());
        updateHTML("videoduration", getDuration());
        updateHTML("videotime", getCurrentTime());
        updateHTML("startbytes", getStartBytes());
        updateHTML("volume", getVolume());
    }


      </script>


<cc1:ModalPopupExtender ID="MPEYTPlayer" runat="server"
        PopupControlID="PopupPopupDiv"
PopupDragHandleControlID="DragPan"
        TargetControlID="hiddenpopupbutton"
BackgroundCssClass="modalBackground" RepositionMode="None">
            </cc1:ModalPopupExtender>


     <asp:Panel Width="400px" CssClass="modalBox" Style="display:
none;" ID="PopupPopupDiv" runat="server">
                <asp:Panel ID="DragPan" SkinID="PopupDragPanel"
runat="server">
                <table class="PopupTable">
                    <tr>
                        <td class="Popup3LeftCell">
                            <asp:Label SkinID="PopupLeftLabel"
ID="Label1" runat="server" text="Video Viewer"></asp:Label>
                        </td>
                        <td class="Popup3CentreCell">
                            <asp:Label SkinID="PopupClickDragLable"
ID="Label3" runat="server" ></asp:Label>


                        </td>
                        <td class="Popup3rightCell">
                            <asp:HyperLink ID="PopupCancelLink"
SkinID="PopupRightLinkClose" runat="server">Close</asp:HyperLink>


                            <asp:Image SkinID="PopupRightImageClose"
ID="Image1" runat="server" />
                        </td>
                    </tr>
                </table>
                </asp:Panel>
                 <asp:Panel ID="TitleFlyoutHoldpan" runat="server">
    </asp:Panel>
    <asp:Panel ID="DetailsViewer" runat="server">
    </asp:Panel>
  <asp:Panel ID="RatingHoldPan" runat="server">


          </asp:Panel>


                                 <asp:Panel ID="RaterHoldPan"
runat="server">
                            </asp:Panel>
         <asp:Panel ID="Panel1" runat="server">
         </asp:Panel>
  <asp:Panel ID="ytapiplayer" runat="server">
       You need Flash player 8+ and JavaScript enabled to view this
video.


      </asp:Panel>
       <div id="ytapiplayerPan">
      You need Flash player 8+ and JavaScript enabled to view this
video.
    </div>


 </asp:Panel>



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"SWFObject" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/swfobject?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to