Forums

[resolved] [plugin: ProPlayer] calling player through PHP (9 posts)

  1. Gerben van Eijk
    Member
    Posted 3 years ago #

    Hello there,

    I am using the proplayer plugin to show video files from various players such as youtube and vimeo. the plugin works great when I add it in a post.

    However I have some of my own videos aswel for which I'd like to generate pages. I have everything set up for it, as in I can retrieve the url data from a database ready to be inserted wherever it needs to go.

    The problem is that I can't seem to call the ProPlayer through php. On the website for the ProPlayer plugin the author said it had to be done like this:

    <?php
    		$player = new ProPlayer();
    		$player->buildPlayer("[pro-player]urlforvideo[/pro-player]");
    		?>

    However, when I use that it doesn't do a thing, when I check the source it's like it doesn't generate any html or javascript whatsoever.

    Does anyone know what I'd need to add or change to make it work?

  2. Gerben van Eijk
    Member
    Posted 3 years ago #

    Shameless bump.. anyone?

  3. SuperMAG
    Member
    Posted 3 years ago #

    you should tell that to the main owner in his site.

    http://isagoksu.com/proplayer-wordpress-plugin/

  4. Gerben van Eijk
    Member
    Posted 3 years ago #

    Well I did, but I´ve not received an answer yet and until then I am quite stuck.. so I just figured I´d broaden the search for an answer a bit and ask it on here aswel.

  5. isa.goksu
    Member
    Posted 3 years ago #

    @Gerben, I'm pretty busy in these days. Very quick answer to ur q is:

    buildPlayer is a function that parses the array of entries. Instead you should use addPlayerCode method to return something back. But I've never tried with that way. So I'm not sure. Just try and let us know please.

    Thanks,
    Isa

  6. Gerben van Eijk
    Member
    Posted 3 years ago #

    Thanks for the reply Isa, I will play around with it and see if I can get it to work.

    As to you being pretty busy, being busy usually means things are going well, so keep it up!

  7. Gerben van Eijk
    Member
    Posted 3 years ago #

    Okay I've got it working.
    It didn't work right of the bat so I did some debugging with echo's in the proplayer.php file to see how far it was getting. But it turns out that for some reason unknown to me at least. it is not actually returning the return from the addPlayerCode function.

    So what I did to solve it is simply echo what it returns which was the $content.

    so just above the
    return $content; I wrote echo $content;
    The problem it then gave is that if I put a video in a post like you normally would, it would show up twice, but I simply fixed that with an if statement to only use the echo when you are on one of the gallery pages and if you're not on the gallery page it will simply use the return.

  8. prodigy2m
    Member
    Posted 2 years ago #

    Gerben van Eijk,

    Can you please paste the whole code that calls the function to pro-player from outside of the content (php). Whatever I do, nothing works. I tried everything, plus I am new to PHP. Thank you in advance. My e-mail is igordesigns@gmail.com.

    Thanks,
    Igor M
    igordesigns@gmail.com

  9. isa.goksu
    Member
    Posted 2 years ago #

    @prodigy2m, just look at the new version. There is a new feature that supports shortcode use.

Topic Closed

This topic has been closed to new replies.

About this Topic