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

Foliovision

  • 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

Adjust settings to "Parse Video and youtube Links"?

[Solved]

Foliovision › Forums › FV Player › How to … › Adjust settings to "Parse Video and youtube Links"?

  • Ken H. 8 years, 1 month ago

    Hey there! Quick question. So I was wondering if I could add a hook in PHP that would allow me to fine tune the “Parse Video and Youtube Links” setting. So right now, the setting will automatically convert all youtube links to FV Player. I have a membership site and I’d like to add a conditional that basically checks the type of member, and depending on their membership, it would display a different fv player shortcode (so high end members have the ability to do looping, slowmotion, etc.) Is there a hook that I could use to help with this? Thanks!

Viewing 5 replies - 1 through 5 (of 5 total)
  • Martin 8 years ago

    Hello Ken,

    the filter is hooked to comments like this:

    add_filter( 'comment_text', 'fv_player_comment_text', 0 );

    — https://github.com/foliovision/fv-wordpress-flowplayer/blob/master/controller/frontend.php#L527

    Then the shorcode parsing is enabled:

    add_filter('comment_text', 'do_shortcode');

    So you could put in another filter at priority between 1-9 which would alter the shortcode using str_replace(). Since you want to detect the user membership level I don’t see how we could make this part of the FV Player settings.

    Thanks,
    Martin

    Ken H. 8 years ago

    Thanks so much! You’re awesome. Would you by chance be able to help me with this? So the code I have below checks membership and if it says “Patreon” then I’d like it to parse the link with FVPlayer (since it has much cooler capabilities than just a youtube link). How could I finish this to make it work?

    $user_id = get_current_user_id();
    $current_level = intVal(get_user_meta($user_id, ‘learndash_plus_level’, true ));
    $levels = learndash_plus_get_levels();
    $currentlevelname = $levels[$current_level][‘name’];
    if (strpos($currentlevelname,$level) == “Patreon”){
    // PARSE THE FVPLAYER SHORTCODE
    }

    Martin 8 years ago

    Hello Ken,

    the code for shortcode adjustment for these comments might look like this, so you can put in your condition easily.

    add_filter('comment_text', 'tweak_fv_player_shortcode', 9 );
    
    function tweak_fv_player_shortcode( $shortcode ) {
      $shortcode = str_replace( '[fvplayer ', '[fvplayer ab="true" ', $shortcode );
      return $shortcode;
    }
    

    Thanks,
    Martin

    Ken H. 8 years ago

    Man, you are awesome! Thanks so much. Worked like a charm and helped a lot! OK, one last question. Is there a way we can also have the parse automatically apply to “posts”? I have a front end blog posting website, so anyone can post video links in their blogs but the parse doesn’t quite catch blog/posts.

    Martin 8 years ago

    Hello Ken,

    I think normally WordPress parses these video links like YouTube or Vimeo into their iframes automatically. Is that happening on your site?

    But you can try what happens if you put this into your theme functions.php:

    add_filter( 'the_content', 'fv_player_comment_text', 0 );

    But ideally FV Player would just overtake the WordPress function I mentioned above.

    Thanks,
    Martin

Viewing 5 replies - 1 through 5 (of 5 total)
Reply To: Adjust settings to "Parse Video and youtube Links"?



Please Sign in or Register to upload files.

Related Posts

  1. Creating Video Links in FV Player

  2. Video Download link with custom styling.

    FV Player’s New Features: Download Links With Simple History Tracking

  3. FV Player’s New Features: Video Links and Other Improvements

Primary Sidebar

How to …

    Categories

    • Business
    • Camera Reviews
    • Case Studies
    • Design
    • FV Player
    • Internet Marketing
    • IT
    • Life
    • SEO
    • Slovak
    • Video of the Week
    • WordPress

    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 © 2026 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‬