I need help changing rtmedia plugin video player.

I'm trying to change the video player for rt media plugin, I have found a guide, but it's not explaining where to insert these codes. Could you try to guide me on changing the video player for rtmedia?

  • Nahid

    Hey Liutauras !
    Hope you are having a great day!

    The first and last snippet of code in the shared guide is Javascript. The simplest way to add Javascript code into a WordPress site is using a custom Javascript plugin, e.g. Simple Custom CSS and JS.

    The second snippet of code needs to be added in your theme's (most preferably, child theme's) functions.php file. This code seems to be 'enqueuing' the JWPLAYER custom library into your theme. However, it doesn't look like the code is complete, i.e. just adding that line won't be enough. Firstly, it'd require you to upload the custom library Javascript file (jwplayer.js) inside "wp-content/themes/{your-theme}/js" directory. You can get your copy of JWPLAYER library here. Then you'd need to enqueue it correctly inserting the following code into the theme's functions.php file instead of the one from the shared guide:

    function jw_library() {
    	wp_enqueue_script( 'custom-jwplayer-js', get_template_directory_uri(). '/js/jwplayer.js', array( 'jquery' ), '20160717', false );
    }
    add_action( 'wp_enqueue_scripts', 'jw_library' );

    You can learn more about enqueuing CSS and Javascript file correctly into WordPress following this handy guide.

    If you're not interested in using a plugin for adding Javascript code, you can alternatively add the code to a Javascript file (.js file extension) and enqueue it in your theme's functions.php file following the same guide mentioned above.

    Hope this helps. Let me know if you need any further assistance regarding this. Thanks!

    Kind regards,
    Nahid

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.