Skip to content
This repository has been archived by the owner on Jan 21, 2022. It is now read-only.

Commit

Permalink
video player title display on play
Browse files Browse the repository at this point in the history
  • Loading branch information
HoraceYork88 authored and jeremyVignelles committed Oct 14, 2018
1 parent 17906ee commit 421ddef
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
using System;
using System.Runtime.InteropServices;

namespace Vlc.DotNet.Core.Interops.Signatures
{
[LibVlcFunction("libvlc_media_player_set_video_title_display")]
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
internal delegate void SetVideoTitleDisplay(IntPtr mp, Position position, int timeout);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
using System;
using System.Runtime.InteropServices;

namespace Vlc.DotNet.Core.Interops.Signatures
{
public enum Position
{
Disable=-1,
Center,
Left,
Right,
Top,
TopLeft,
TopRight,
Bottom,
BottomLeft,
BottomRight
}
}
21 changes: 21 additions & 0 deletions src/Vlc.DotNet.Core.Interops/VlcManager.SetVideoTitleDisplay.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
using System;
using Vlc.DotNet.Core.Interops.Signatures;

namespace Vlc.DotNet.Core.Interops
{
public sealed partial class VlcManager
{
/// <summary>
/// Set if, and how, the video title will be shown when media is played.
/// </summary>
/// <param name="mediaPlayerInstance">The media player instance</param>
/// <param name="position">position at which to display the title, or libvlc_position_disable to prevent the title from being displayed</param>
/// <param name="timeout">title display timeout in milliseconds (ignored if libvlc_position_disable)</param>
public void SetVideoTitleDisplay(IntPtr mediaPlayerInstance, Position position, int timeout)
{
if (mediaPlayerInstance == IntPtr.Zero)
throw new ArgumentException("Media player instance is not initialized.");
GetInteropDelegate<SetVideoTitleDisplay>().Invoke(mediaPlayerInstance, position, timeout);
}
}
}
5 changes: 5 additions & 0 deletions src/Vlc.DotNet.Core/VlcMediaPlayer/VlcMediaPlayer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,11 @@ public bool TakeSnapshot(FileInfo file, uint width, uint height)
return TakeSnapshot(0, file.FullName, width, height);
}

public void SetVideoTitleDisplay(Position position, int timeout)
{
Manager.SetVideoTitleDisplay(myMediaPlayerInstance, position, timeout);
}

/// <summary>
/// Take a snapshot of the current video window.
/// </summary>
Expand Down

0 comments on commit 421ddef

Please sign in to comment.