• Skip to content
  • Skip to primary sidebar
  • Skip to footer

Foliovision

Main navigation

  • Weblog
    • FV Player
    • WordPress
    • Video of the Week
    • Case Studies
    • Business
  • About
    • Testimonials
    • Meet the Team
    • We Support
    • Careers
    • Contact
    • Pricing
  • Products
  • Support
    • FV Player Docs
    • Pro Support
  • Login
  • Basket is empty

wp_ajax_ do_shortcode

[Solved]

Foliovision › Forums › FV Player › How to … › wp_ajax_ do_shortcode

  • dot4all 10 years, 11 months ago

    Hi all,

    Can I call fv in ajax function?

    In my ajax test, function return post_content with [fvplayer src='video.mp4' width=500 splash='thumb.png' splashend=show] but it’s not converted by do_shortocode.

    Can you help me?

    Thank you

Viewing 10 replies - 1 through 10 (of 10 total)
  • dot4all 11 years ago

    I’ve tested it with other shortcode and it’s ok. What’s wrong with fvplayer shortcode?

    Thanks

    David

    Martin 11 years ago

    Hello David,

    I’m not sure what could be causing your issue as we use the standard WordPress shortcode API. Are you sure it works with shortcode like [gallery]? Are you sure your working shortcode is not getting some special treatment? You need to use the_content() or apply_filters(), as the shortcodes are not processed otherwise. Then you need to load Flowplayer on the resulting DIV element, similar to what is at the end of the document here: http://foliovision.com/player/api-programming

    Thanks,
    Martin

    dot4all 11 years ago

    Hi Martin,

    thank you for your response. I’ve tried with my custom shortcode, with [gallery ids="2377,2376,2374"] shortcode, and all it’s ok. I don’t understand why with fvplayer shortcode doesn’t work.

    My test: when click on link, I call ajax function that return do_shortcode(‘[gallery ids="2377,2376,2374"]‘) and replace div with html response and I see gallery image

    When I use do_shortcode(‘[fvplayer src="http://amazonaws.com/test.mp4" width=500 splash="http://site.com/wp-content/uploads/2013/02/videoAnteprima-thumb.png" splashend=show]‘) and replace html, I see shortcode as string and doesn’t convert as video.

    I’ve checked that calling floplayer_content_handle() function (/controller/shortcode.php) I get this:
    Fatal error: Call to undefined function flowplayer_content_handle() in ajax-functions/init.php on line 57

    I think that flowplayer doesn’t load in ajax envirovment.

    Can you help me? Thank you

    dot4all 11 years ago

    Hi Martin,

    I did some debig and seems that not all file are loaded in ajax envirovment.

    In my ajax call I had to include controller/shortcodes.php but I get
    Fatal error: Call to undefined method flowplayer_backend::build_min_player() in /fv-wordpress-flowplayer/controller/shortcodes.php on line 182

    Then I re-initialized again $fv_fp = new flowplayer_frontend(); in controller/shortcodes.php for testing pourpose and I get splash screen correctly but with error
    Admin warning:
    I’m sorry, your JavaScript appears to be broken. Please use “Check template” in plugin settings or order our pro support and we will get it fixed for you.

    Martin 11 years ago

    Hello David,

    you can remove that notice using JavaScript. You need to use JavaScript anyway to initialize Flowplayer on the DIV element which contains the player.

    It sounds like an interesting project and I see we could improve this (the backend/frontend stuff could be improved). However currently we are under a heavy load of more end-user features to add.

    If you need this resolved quickly or it’s important for your work, we are happy to help you with the coding if you make a donation, or we can incorporate your changes if you are able to do this properly. Are you also sure you absolutely need AJAX here?

    Thanks,
    Martin

    dot4all 11 years ago

    Hi Martin,

    thank you for your response. Soon I’ll buy license for our project.

    I need to use ajax to load content but I currently use a loophole like this
    $(‘.content’).load($(this).attr(‘href’)+’ .flowplayer’,function(){
    jQuery(‘.flowplayer’).flowplayer();
    });
    And this loophole does work.
    But I don’t understand why if I call jQuery(‘.flowplayer’).flowplayer().play(); I get an error: Uncaught TypeError: undefined is not a function
    If I use this after jQuery(‘.flowplayer’).flowplayer()
    var api = flowplayer();
    api.bind(‘ready’, function() {
    alert( ‘Video just started!’ );
    });
    I doesn’t see alert

    Thank you

    Martin 11 years ago

    Hello David,

    do you see fv-flowplayer.min.js on that page? If not, enable Integrations -> Load FV Flowplayer JS everywhere. That might be it.

    Thanks,
    Martin

    dot4all 11 years ago

    Yes I have //cdn.foliovision.com/plugins/fv-wordpress-flowplayer/flowplayer/fv-flowplayer.min.js?ver=2.2.7 in the footer

    dot4all 11 years ago

    Hi Martin,

    Ok I’ve understand that with this method I can play video

    jQuery(‘.flowplayer’).flowplayer();
    var api = flowplayer();//with this we get first instance of player
    api.load(); //play video

    api.play() //not load video
    jQuery(‘.flowplayer’).flowplayer().load() //return error undefined

    if I’ve more info I share here

    Martin 11 years ago

    Hello David,

    working with load() and play() is not always so obvious, as it works a bit differently for iPad etc.

    Following should play any video you insert in JavaScript:

    jQuery('#your-player-element').flowplayer();
    var api = jQuery('#your-player-element').data('flowplayer');
    api.load();

    Thanks,
    Martin

Viewing 10 replies - 1 through 10 (of 10 total)
Reply To: wp_ajax_ do_shortcode



Please Sign in or Register to upload files.

Related Posts

  1. Amazon Cloudfront mit Schutz beim Herunterladen

    Amazon Cloudfront mit Schutz beim Herunterladen

  2. Splash Image at the End

  3. Náhledový obrázek na konci videa

Primary Sidebar

Sign in Register
FV Player Docs Post New Topic

Welcome

to Foliovision support forums! We'll be happy to provide free support to resolve all the reported bugs. You always can start by specifying your OS and browser and steps to reproduce the bug.

If you need help with the installation on your site, please submit a request for a Pro Support Incident. We'll have you up and running in no time, with detailed instructions on how to resolve your issue yourself in the future.

Facing a hard to solve WordPress problem? On a tight deadline?

Let us take care of it for you
right now.

Pro Support Buy FV Player

Footer

Our Plugins

  • FV WordPress Flowplayer
  • FV Thoughtful Comments
  • FV Simpler SEO
  • FV Antispam
  • FV Gravatar Cache
  • FV Testimonials

Free Tools

  • Pandoc Online
  • Article spinner
  • WordPress Password Finder
  • Delete LinkedIn Account
  • Responsive Design Calculator
Foliovision logo
All materials © 2025 Foliovision s.r.o. | Panská 12 - 81101 Bratislava - Slovakia | info@foliovision.com
  • This Site Uses Cookies
  • Privacy Policy
  • Terms of Service
  • Site Map
  • Contact
  • Tel. ‭+421 2/5292 0086‬

We are using cookies to give you the best experience on our website.

You can find out more about which cookies we are using or switch them off in .

Powered by  GDPR Cookie Compliance
Privacy Overview

This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.

Necessary Cookies

Strictly Necessary Cookie allow you to log in and download your software or post to forums.

We use the WordPress login cookie and the session cookie.

If you disable this cookie, we will not be able to save your preferences. This means that every time you visit this website you will need to enable or disable cookies again.

Support Cookies

Foliovision.com uses self-hosted Rocket.chat and self-hosted Freescout support desk to provide support for FV Player users. These cookies allow our visitors to chat with us and/or submit support tickets.

We are delighted to recommend self-hosted Rocket.chat and especially Freescout to other privacy-conscious independent publishers who would prefer to self-host support.

Please enable Strictly Necessary Cookies first so that we can save your preferences!

3rd Party Cookies

This website uses Google Analytics and Statcounter to collect anonymous information such as the number of visitors to the site, and the most popular pages.

Keeping this cookie enabled helps us to improve our website.

We reluctantly use Google Analytics as it helps us to test FV Player against popular Google Analytics features. Feel free to turn off these cookies if they make you feel uncomfortable.

Statcounter is an independent Irish stats service which we have been using since the beginning of recorded time, sixteen years ago.

Please enable Strictly Necessary Cookies first so that we can save your preferences!