craft-videoembedder icon indicating copy to clipboard operation
craft-videoembedder copied to clipboard

Video Title

Open rjhewitt3 opened this issue 5 years ago • 2 comments

It'd be great to be able to pull the Video's title too!

rjhewitt3 avatar May 14 '19 14:05 rjhewitt3

+1

beneklisefski avatar Jun 05 '19 23:06 beneklisefski

Sorry for the delay! I'm answering this blindly without testing, but you should be able to use the getTitle function:

{% set videoUrl = 'https://www.youtube.com/watch?v=6xWpo5Dn254' %}
{% set videoTitle = craft.videoEmbedder.getTitle(videoUrl) %}

{% if videoTitle | length %}
    <h2>{{ videoTitle }}</h2>
{% endif %}

mikestecker avatar Oct 23 '19 22:10 mikestecker