Foliovision › Forums › FV Player › Requests and Feedback › Is it possible to create an integration for mycred?
-
-
Hello amiremami.
sorry about the delay.
You can script around FV Flowplayer to have an Ajax call running at the end of each video. does myCRED provide any hooks which could be initiated using Ajax? If no, then it would also require some extra PHP code. Such code can be seen here: https://gist.github.com/gabrielmerovingi/5536bdf423ca6c5c79e3
Do you have access to myCRED support to ask them how to trigger their hooks using JavaScript in some good way?
Thanks,
MartinHi Martin
Really thanks for your reply and help. I contacted Mycred founder, Gabriel and explained the issue. Here is Gabriel’s answer:Yeah you probably would be best of creating a custom hook that handles that ajax call and acts upon it.
Here is a skeleton hook I wrote for this that could get you started.
You would need to build the AJAX call handler and update the hook ajax handler to intercept these calls and act.We would need a unique identifier for each video that a user watches and I am not sure what kind of ids FV uses. YouTube uses alphanumeric ids while Vimeo uses pure numbers. I have added in some inline documentation in the hook to point out where you need to add code. It’s basically the run() and ajax_handler() methods that needs to be completed.
Thank you so much
Hello amiremami.
thank you for the input from myCRED developers.
I can see how this could work and it’s not a huge job. Flowplayer has a hook to detect video end, but it means user can just skip to the end of the video. But there is a way of tracking that, we done that for our improved Google Analytics tracking.
I can see how we can improve our documentation for use face like this, but I’m not sure how we can add an feature like this to our plugin since it also requires custom code in myCRED, we will have a look in our team.
Thanks,
MartinReally appreciate your support and help Martin.
I want only add one thing:
“but I’m not sure how we can add an feature like this to our plugin since it also requires custom code in myCRED”
Usually authors make the mycred compatibility feature as a separate plugin. (exactly same as your fv player pro which is separate from the main, I mean separate files)
And anyone need mycred compatibility can download from mycred site. For example here:
http://mycred.me/about/supported-plugins/#custom-buildsDisclaimer: I am not related to mycred in any way.
Thanks again
Hello amiremami,
here’s a sample code for FV Player which detects if the user really watched the video to the end (seeking to the end won’t suffice) and then sends the post ID using Ajax: https://gist.github.com/foliovision/2c266598333ecbd1f151
If you know PHP and JavaScript it should be possible for you to link it all together
Thanks,
Martin