This is a migrated thread and some comments may be shown as answers.

Embed Video

1 Answer 77 Views
ToolTip
This is a migrated thread and some comments may be shown as answers.
MICHELE IANNACCI
Top achievements
Rank 1
MICHELE IANNACCI asked on 23 Jun 2014, 04:14 PM
Is it possible to embed video (mp4, mov, ...) into RadToolTipManager?

1 Answer, 1 is accepted

Sort by
0
Accepted
Marin Bratanov
Telerik team
answered on 25 Jun 2014, 10:22 AM

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.

 
Tags
ToolTip
Asked by
MICHELE IANNACCI
Top achievements
Rank 1
Answers by
Marin Bratanov
Telerik team
Share this question
or