add image graphics element (#2288)
This commit is contained in:
@@ -380,7 +380,9 @@ public class FFmpegLibraryProcessService : IFFmpegProcessService
|
||||
switch (playoutItemGraphicsElement.GraphicsElement.Kind)
|
||||
{
|
||||
case GraphicsElementKind.Text:
|
||||
var maybeElement = await TextGraphicsElement.FromFile(playoutItemGraphicsElement.GraphicsElement.Path);
|
||||
{
|
||||
var maybeElement =
|
||||
await TextGraphicsElement.FromFile(playoutItemGraphicsElement.GraphicsElement.Path);
|
||||
if (maybeElement.IsNone)
|
||||
{
|
||||
_logger.LogWarning(
|
||||
@@ -399,7 +401,34 @@ public class FFmpegLibraryProcessService : IFFmpegProcessService
|
||||
|
||||
graphicsElementContexts.Add(new TextElementContext(element, variables));
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
case GraphicsElementKind.Image:
|
||||
{
|
||||
var maybeElement =
|
||||
await ImageGraphicsElement.FromFile(playoutItemGraphicsElement.GraphicsElement.Path);
|
||||
if (maybeElement.IsNone)
|
||||
{
|
||||
_logger.LogWarning(
|
||||
"Failed to load image graphics element from file {Path}; ignoring",
|
||||
playoutItemGraphicsElement.GraphicsElement.Path);
|
||||
}
|
||||
|
||||
foreach (var element in maybeElement)
|
||||
{
|
||||
// var variables = new Dictionary<string, string>();
|
||||
// if (!string.IsNullOrWhiteSpace(playoutItemGraphicsElement.Variables))
|
||||
// {
|
||||
// variables = JsonConvert.DeserializeObject<Dictionary<string, string>>(
|
||||
// playoutItemGraphicsElement.Variables);
|
||||
// }
|
||||
|
||||
graphicsElementContexts.Add(new ImageElementContext(element));
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
default:
|
||||
_logger.LogInformation(
|
||||
"Ignoring unsupported graphics element kind {Kind}",
|
||||
|
||||
Reference in New Issue
Block a user