• Resolved mryan2013

    (@mryan2013)


    Hi, the plugin is great. I had a few questions about the Youtube video hook:

    1. Right now the youtube hook uses the Flash version of the youtube clip. As a result, it can’t be seen on a mobile device. Is there anyway to make it use the html5/non-flash version from youtube?

    2. Can you tell us how to use self hosted mp4/non-youtube clips with mycred?

    3. The log file doesn’t show which clip had points given. How can we change it so the log shows the page name and vid clip i.d.?

    Thanks.

    https://www.ads-software.com/plugins/mycred/

Viewing 1 replies (of 1 total)
  • Plugin Author myCred

    (@designbymerovingi)

    Hi mryan

    1. That is correct, it uses the flash version. Unfortunately I am not that well versed in the YouTube API to know how one could use the html version. The current YouTube support in myCRED is really the limits of my expertes on the subject. It is however on my list to try and improve this feature, but I have no direct idea of when this would happen.

    2. The Points for viewing videos uses the YouTube API to detect video actions and award points accordingly. It is not compatible with self hosted files since there are so many unknown variables for me to write something that suits “all”. I guess it all depends on how you manage your videos, how they are stored and and inserted into your posts.

    3. You can use the mycred_parse_log_entry_{reference} filter to hook in and customize the log template. For viewing youtube clips the reference is “watching_video” and the Videos YouTube id is saved with the log entry.

    Example: Replace the custom template tag: %video_id% with the youtube video id.

    add_filter( 'mycred_parse_log_entry_watching_video', 'customize_log_template', 10, 2 );
    function customize_log_template( $content, $log_entry )
    {
    	// The video id is stored in the data column
    	$video_id = $log_entry->data;
    	// Replace %video_id% with the id.
    	return str_replace( '%video_id%', $video_id, $content );
    }

    Note. There are other filters you could use to achieve the same result but this is best since it only fires for log entries related to watching videos.

Viewing 1 replies (of 1 total)
  • The topic ‘Youtube’ is closed to new replies.