Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Description to show #26

Open
pthorup opened this issue Dec 14, 2016 · 7 comments
Open

Description to show #26

pthorup opened this issue Dec 14, 2016 · 7 comments

Comments

@pthorup
Copy link

pthorup commented Dec 14, 2016

Hi,
Any idea how the description can show up in the playlist?

@redolivedev
Copy link

I would also like to know how to get the video descriptions to show up in the playlist.

@pthorup
Copy link
Author

pthorup commented Jan 13, 2017

I really needed this done so went and changed one of the core files with the code below:

// Video Description var descEl = document.createElement("p"); var descText = item.description || this.localize("No Description"); descEl.className = "vjs-playlist-desc"; descEl.appendChild(document.createTextNode(descText)); descEl.setAttribute("description", descText); descContainerEl.appendChild(descEl);

I placed it in the videojs-playlist-ui.js file. Worked perfectly after that.

@pthorup pthorup closed this as completed Jan 13, 2017
@pthorup pthorup reopened this Jan 13, 2017
@oshihirii
Copy link

Descriptions aren't showing up for me either, as they do on the advanced example demonstration here.

Video.js 5.16.0

videojs-playlist
version 3.0.1

videojs-playlist-ui - v3.0.0 - 2016-09-08

@1nspect0rGadget
Copy link

Any breakthroughs with this? Where is a good place to place the code poonamthorup posted above. Thanks.

@1nspect0rGadget
Copy link

Add this after line 199 where the li is constructed.

// Name and description
  var name = document.createElement('cite');
  var nameValue = item.name || this.localize('Untitled Video');
  name.className = 'vjs-playlist-name';
  name.appendChild(document.createTextNode(nameValue));
  name.setAttribute('title', nameValue);
  li.appendChild(name);

  if (item.description) {
    var description = document.createElement('p');
    description.className = 'vjs-playlist-description';
    description.appendChild(document.createTextNode(item.description));
    description.setAttribute('title', item.description);
    li.appendChild(description);
  }

@j-arred
Copy link

j-arred commented May 25, 2017

I downloaded what I think was the most recent version, and just used the existing code design pattern to add it in. I was at line 301 when I added this, where the LI is being constructed, just as is mentioned above. I was using a description no matter what so I didn't check for one, though I think you could probably pass an empty string instead of something like "No Description" like I did. I also like checking for the description, as done above, I just knew I always needed one...

//Video descrption
	var descEl = document_1.createElement('description');
	var descText = item.description || this.localize('No Description');
	
	descEl.className = 'vjs-playlist-description';
	descEl.appendChild(document_1.createTextNode(descText));
	descEl.setAttribute('title', descText);
	titleContainerEl.appendChild(descEl);

The class already matches up with existing styles, and can be overwritten with inline styles, though I had to use !important.

@Ghanendra1209
Copy link

You can also try the steps mentioned in - https://player.support.brightcove.com/references/video-metadata-mediainfo.html
Basically, you can get the description as well in js using videojs.getPlayer('myPlayerID').mediaInfo.description

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants