sampotts / plyr

A simple HTML5, YouTube and Vimeo player
https://plyr.io
MIT License
26.07k stars 2.91k forks source link

VAST Compatibilty #188

Open prateekkathal opened 8 years ago

prateekkathal commented 8 years ago

Hello,

Is the player VAST Compatible? If yes, where can I get the documentation for it? If no, are you planning on it? When do you think you'll be able to release it?

Waiting....

Thanks,

sampotts commented 8 years ago

I'll add it to the list but there's streaming and playlists to get done first

prock13 commented 8 years ago

@SamPotts: I also would like to deliver pre-rolls with your player. So I took your player and attempted to add pre-rolls using Google's IMA HTML SDK (https://developers.google.com/interactive-media-ads/docs/sdks/html5/).

So far I have a working prototype that delivers the prerolls in an adContainer absolutely positioned above the player and once the ad ends, it hides the container and plays the video.

Here is my example: https://developers.google.com/interactive-media-ads/docs/sdks/html5/

The issues I am facing are the following:

I know you have other items in your list to attend to, but given that I'm so close would you be willing to help finish this?

sampotts commented 8 years ago

Sorry I've not gotten around to this. It's hard to find the time and to prioritise everything.

In regards to your issues:

Were you going to make this part of the core code or some sort of add-on? I've been meaning to create a modularised setup to allow for plugins but just haven't got around to it.

prock13 commented 8 years ago

Thanks for the reply. So I setup a much simpler example using only Vimeo in this case (because we have a Vimeo Pro account and that's what I need to get working).

In regards to my points, after correcting how I was getting the instance of the player, I was able to use the API to play the Vimeo video after the ad completes. The other issue I had is that I was trying to create a listener for when the video finished playing, in case we wanted to show a post-roll, but I'm still working through how do to do that correctly in the Google SDK.

It does in fact seem that I can't add the source dynamically without having an original element. That's not a huge issue, but it would be best to load the video source after the ad finishes instead of taking the hit when the player originally loads. I'll keep looking into this.

I'm also going to spend some more time on responsive and the ad size issue.

Finally, as for making this part of the core or an add-on, I think it would work best as an add-on given that I have not touched the core code at all as of now. Now, once we start looking to do mid-roll ads, then we will need the ability to tell when the player is half way through the video so we can pause it, show the ad and then start the video back up. It's possible the API may already have this but I haven't checked yet.

Here's the simple Vimeo example that I setup: http://dev.salvogroup.co/plyr-master/examples/vimeo/

prock13 commented 8 years ago

This does not work for me:

var player = document.querySelector('.js-media-player').plyr; player.addEventListener('ready', function() { var player = event.target.plyr; });

I get a type error. Any ideas why?

sampotts commented 8 years ago

Sorry that's a typo in the docs - try adding event as an argument to the callback.

var player = document.querySelector('.js-media-player').plyr;
player.addEventListener('ready', function(event) {
var player = event.target.plyr;
});
prock13 commented 8 years ago

That works but I'm still not sure how to set an eventListener for when the video ends (in this case Vimeo if it's different that YT or regular video). Mind modifying the event example above to listen for "ended"?

prock13 commented 8 years ago

Also, as you can see here: http://dev.salvogroup.co/plyr-master/examples/vimeo/ It's working now. But in the console I'm seeing an error "TypeError: Se.progress is undefined" any idea why?

sampotts commented 8 years ago

I think it would just be using the ended event:

var player = document.querySelector('.js-media-player').plyr;
player.addEventListener('ended', function(event) {
    var player = event.target.plyr;
});

Did you try that and no luck?

prock13 commented 8 years ago

No luck on that...

sampotts commented 8 years ago

The buffer error I will fix very shortly.

I think the docs were incorrect here. I will update but try this code:

var container = document.querySelector('.js-media-player');
container.addEventListener('ended', function(event) {
    var player = event.target.plyr;
});

The change is that events fire on the container, rather than the plyr object so you can't bind to that. Try that instead?

sampotts commented 8 years ago

Ah no the docs were correct - I just didn't relay it correctly đź‘Ť

prock13 commented 8 years ago

That worked!

prateekkathal commented 7 years ago

Any updates on this? When will this be added to the source code/made part of the original code?

chrisbbreuer commented 7 years ago

I would love to see if there are any updates on this as well, as that's one of the features I am required to use

snipiba commented 5 years ago

Some changes with this Feature request?

nightsurge commented 5 years ago

Yeah, any update on this? I do not want to use vi.ai, I would like to use my own ad networks and VAST/VPAID tags.

nightsurge commented 5 years ago

Just an fyi to all following this and @sampotts it looks like enabling ads and using the "tagUrl" works with VAST!

See pen: https://codepen.io/nightsurge/pen/NVQGyJ

cschellhas commented 5 years ago

Just an fyi to all following this and @sampotts it looks like enabling ads and using the "tagUrl" works with VAST!

See pen: https://codepen.io/nightsurge/pen/NVQGyJ

But it wont work with Vimeo videos. https://codepen.io/anon/pen/bPQdEa

sampotts commented 5 years ago

No it won’t as that’s against their terms of service. Same applies for YouTube.

kfe908 commented 3 years ago

It does not work with any custom VAST :-) If you are not using google, you get an error. Plyr docs says "custom VAST" - that's incorrect and a bug if you look in the source code. In most use cases this is not very helpful and useful.

Is there any way to use own ad videos with Plyr?

sampotts commented 3 years ago

Others have had it working with custom VAST. If you've found a bug, open a PR đź‘Ť

mat-etx commented 3 years ago

Hello, Does it work for audio player too? thks,

akash-s-simformsolutions commented 1 year ago

Do we have any updates on Audio player ads ?

WesleyCarnicl commented 1 year ago

How would we do that with WordPress

Just an fyi to all following this and @sampotts it looks like enabling ads and using the "tagUrl" works with VAST!

See pen: https://codepen.io/nightsurge/pen/NVQGyJ

JMcrafter26 commented 2 months ago

Any progress on this?