• Out of the box feature wise its OK but i found a lot of the coding was ancient and some things were missing. I believe the devs are either lazy or they haven’t uploaded the right update to wordpress, they claim that a lot of the issues were fixed in version 3.0 that i came across like the date been november 30th -0001 (fix below) and the switch to iframe which none of them were I know this because version 3.0 is the most current one and its the one i started on, when i searched the php files all the code they claimed to have replaced was still present.

    I mostly add my YouTube game play videos to my site and this is the first problem, this plugin is flash based which YouTube no longer supports making this plugin pretty much redundant for YouTube content creator until the fix i found on there forums which I will share below.

    No playlist support, i found i couldn’t add any playlist to my site via this plugin. the playlist feature is for users to put together which again doesn’t work, I will try to add support for youtube playlists myself and share once it done.

    Fixes

    Flash to iframe Fix (remember to always backup your files in case anything goes wrong)

    Find this file
    wp-content/plugins/contus-video-gallery/front/views/videohome.php and open file videohome.php

    Search for this code

    
    /** If browser is detect then play videos via flash player using embed code */
    $div .= '<embed id="player" src="' . $swf . '" flashvars="baserefW=' . $this->_siteURL . $baseref . $showplaylist . '&mtype=playerModule" width="' . $settingsData->width . '" height="' . $settingsData->height . '" allowFullScreen="true" allowScriptAccess="always" type="application/x-shockwave-flash" wmode="transparent" />';

    Once found replace this code with this

    
    f (strpos ( $videoUrl, 'youtube' ) > 0) {
    /** Iframe code for youtube videos */
    $videoId1 = getYoutubeVideoID ( $videoUrl );
    $div='<div id="player"></div><script>var tag = document.createElement("script");tag.src = "https://www.youtube.com/iframe_api";var firstScriptTag = document.getElementsByTagName("script")[0];firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);var player;function onYouTubeIframeAPIReady() {player = new YT.Player("player", {width: "'.$settingsData->width .'",height: "'.$settingsData->height .'",videoId: "'.$videoId1.'",playerVars: {"rel": 0,"showinfo":0,"modestbranding":0},events: {"onStateChange": onPlayerStateChange}});}var done = false;function onPlayerStateChange(event) {if (event.data == YT.PlayerState.PLAYING && !done) {currentVideoP('.$videoId.');done = true;}}</script>';
    } else{
    /** If browser is detect then play videos via flash player using embed code */
    $div .= '<embed id="player" src="' . $swf . '" flashvars="baserefW=' . $this->_siteURL . $baseref . $showplaylist . '&mtype=playerModule" width="' . $settingsData->width . '" height="' . $settingsData->height . '" allowFullScreen="true" allowScriptAccess="always" type="application/x-shockwave-flash" wmode="transparent" />';
    }

    save this file, in the same folder edit the videodetailpage.php file

    Replace this code

    
    $output .= '<div id="flashplayer"><embed src="' . $this->_swfPath . '" flashvars="' . $flashvars . '" width="' . $width . '" height="' . $height . '" allowfullscreen="true" allowscriptaccess="always" type="application/x-shockwave-flash" wmode="transparent"></div>';

    With this

    
    foreach ( $fetched as $media ) {
    $videourl = $media->file;
    $file_type = $media->file_type;
    $imgurl = getImagesValue ( $media->image, $file_type, $media->amazon_buckets, '');
    }
    if (strpos ( $videourl, 'youtube' ) > 0) {
    $videoid = getYoutubeVideoID ( $videourl );
    $output .='<div id="player"></div><script>var tag = document.createElement("script");tag.src = "https://www.youtube.com/iframe_api";var firstScriptTag = document.getElementsByTagName("script")[0];firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);var player;function onYouTubeIframeAPIReady() {player = new YT.Player("player", {width: "'.$width.'", height:"'.$height.'",videoId: "'.$videoid.'",playerVars: {"rel": 0,"showinfo":0,"modestbranding":0},events: {"onStateChange": onPlayerStateChange}});}var done = false;function onPlayerStateChange(event) {if (event.data == YT.PlayerState.PLAYING && !done) {currentVideoP('.$videoId.');done = true;}}</script>';
    
    } else{
    
    $output .= '<div id="flashplayer"><embed src="' . $this->_swfPath . '" flashvars="' . $flashvars . '" width="' . $width . '" height="' . $height . '" allowfullscreen="true" allowscriptaccess="always" type="application/x-shockwave-flash" wmode="transparent"></div>';
    }

    Save and that should fix you flash

    Wrong date fix
    If your videos are displaying the date as November 30th -0001
    Go to this file wp-content/plugins/contus-video-gallery/admin/controllers/videosSubController.php

    Find this code

    //$videoData ['post_date'] = date ( 'Y-m-d H:i:s' ); and remove the // from the front of it and save the file, this should sort out the wrong date but you will have to edit and click publish on all videos displaying the wrong date to fix them

    Anyway sorry for the wall of text hope what i put helps

    • This topic was modified 7 years, 7 months ago by t3fury.
    • This topic was modified 7 years, 7 months ago by t3fury.
  • The topic ‘Its ok feature wise but here’s some fixes’ is closed to new replies.