Embed Video

2 posts, 1 answers
  1. MICHELE IANNACCI
    MICHELE IANNACCI avatar
    1 posts
    Member since:
    Oct 2008

    Posted 23 Jun 2014 Link to this post

    Is it possible to embed video (mp4, mov, ...) into RadToolTipManager?
  2. Answer
    Marin Bratanov
    Admin
    Marin Bratanov avatar
    3602 posts

    Posted 25 Jun 2014 Link to this post

    Hello Michelle,

    Perhaps the easiest way to do this is to add a RadMediaPlayer in the tooltip. You can use its API to start and stop it when the tooltip shows and hides. Here is a small example:

    <telerik:RadToolTip ID="RadToolTip1" runat="server" TargetControlID="target" IsClientID="true"
                        Width="730px" Height="410px" Position="BottomRight" RelativeTo="Element" HideEvent="ManualClose"
                        OnClientShow="startPlayer" OnClientHide="pausePlayer">
        <telerik:RadMediaPlayer ID="RadMediaPlayer1" runat="server" Width="700px" BackColor="Black"
                                StartVolume="80" Height="394px">
            <Sources>
                <telerik:MediaPlayerSource Path="~/media-player-in-tooltip/appBuilder.mp4" />
            </Sources>
        </telerik:RadMediaPlayer>
    </telerik:RadToolTip>
    <script type="text/javascript">
        function startPlayer(sender, args) {
            var mediaPlayer = getChildMediaPlayer(sender.get_contentElement());
            mediaPlayer.play();
        }
         
        function pausePlayer(sender, args) {
            var mediaPlayer = getChildMediaPlayer(sender.get_contentElement());
            mediaPlayer.pause();
        }
         
        function getChildMediaPlayer(ttipContentElem) {
            return $telerik.$(".RadMediaPlayer", ttipContentElem).first()[0].control;
        }
    </script>

    I am also attaching here a small sample.

    You may find useful the list of supported media types: http://demos.telerik.com/aspnet-ajax/media-player/examples/functionality/mediatypes/defaultcs.aspx.

    Of course, you can use your own media player, or regular embed tags to play the files you need.

    Regards,

    Marin Bratanov
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top