0 Replies Latest reply on Sep 20, 2011 2:13 PM by Flexmaniac

    Embedding video player in TLF

    Flexmaniac Level 1

      Hi Guys,

       

      Can we add a video player to a Richeditable text, if yes what is wrong in the code below? I can see it adds to the editor but soesnt show up

       

       

      <?xml version="1.0" encoding="utf-8"?>

      <!--

      // Copyright (C) 2009 Rad3 Limited.

      // All Rights Reserved.

      // If you have received this file from a source other than Rad3,

      // then your use, modification, or distribution of it requires

      // the prior written permission of Rad3.

      // -->

      <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"

                                       xmlns:s="library://ns.adobe.com/flex/spark"

                                       xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600" creationComplete="initApp();">

                <fx:Declarations>

                          <!-- Place non-visual elements (e.g., services, value objects) here -->

                </fx:Declarations>

       

                          <fx:Script>

                                    <![CDATA[

                                              import flashx.textLayout.edit.EditManager;

                                              import flashx.textLayout.edit.SelectionState;

       

                                              import mx.controls.Alert;

       

                                              import spark.components.VideoDisplay;

                                              import spark.components.VideoPlayer;

       

                                    private var _videoDisplay:VideoPlayer;

                                    private var _editManager:EditManager;

                                    private var _videoContainer:Sprite;

       

                                    private function initApp():void

                                    {

                                              var videoPath:String = "sample_vid.flv";

       

                                              _videoDisplay = new VideoPlayer();

                                              _videoDisplay.source = videoPath;

       

       

                                              _videoContainer = new Sprite();

       

                                              _videoContainer.width = 200;

                                              _videoContainer.height = 200;

       

                                              //_videoDisplay.play();

                                              // add the video

                                              _videoContainer.addChild(_videoDisplay);

       

       

                                              _editManager = rte.textFlow.interactionManager as EditManager;

                                              _editManager.insertInlineGraphic(_videoContainer, 500,400, null, new SelectionState(rte.textFlow, 0, 0));

                                    }

       

                                    ]]>

                          </fx:Script>

       

                          <s:RichEditableText id="rte" width="100%" height="100%"/>

       

      </s:Application>

       

       

      Thanks