Skip to content

Additional data missing for media objects #144

@anita-chouhan

Description

@anita-chouhan

I am using the oEmbed plugin to render media embeds. Currently, the field type methods (entry.field.media and entry.field.embed) are returning very few details for the embed object.

Example
Using the below code:
{% dd(entry.field.media) %}

returns only:
Screenshot 2023-11-27 at 2 27 56 PM
I need some other media details like type, provider name etc for different purposes. Can you please look into it?

Steps to reproduce

  1. Create a Craft CMS entry with an oEmbed field.
  2. In the field value set any YouTube or Vimeo URL.
  3. In the frontend template try to render media type using the below method
    {{ entry.field.media.type }}

Input field value
YouTube Link: https://www.youtube.com/watch?v=35kwlY_RR08

Expected Output
Additional media details as mentioned in the plugin doc.

entry.field.media.title
entry.field.media.description
entry.field.media.url
entry.field.media.type
entry.field.media.image
entry.field.media.imageWidth
entry.field.media.imageHeight
entry.field.media.code
entry.field.media.width
entry.field.media.height
entry.field.media.aspectRatio
entry.field.media.authorName
entry.field.media.authorUrl
entry.field.media.providerName
entry.field.media.providerUrl
entry.field.media.providerIcons
entry.field.media.providerIcon
entry.field.media.publishedDate

Additional Information
PHP version: 8.0.15
Craft CMS version: 3.8.17
oEmbed version: 1.13.19

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions