I have been attempting to run a function once a video finishes playing. The function is located within an angular controller, but I am encountering an error message that reads:
ReferenceError: postVendor is not defined
Below is the JavaScript code where the function is being called:
$.noConflict();
jQuery(document).ready(function ($) {
var api = flowplayer();
api.bind("finish", function (e, api) {
var data = "true";
var url = "someurlhere";
postVendor(url, data);
});
});
Here is the module/controller setup in the same file:
var registrationModule = angular.module('registrationModule', []);
registrationModule.controller("vendorCtrl", function ($scope, $http) {
$scope.postVendor = function (url, data) {
$http.post(url, data).success(function (data) { console.log(data) }).error(function (data) { console.log(data) });
};
});
Within my HTML markup:
<html xmlns="http://www.w3.org/1999/xhtml" ng-app="registrationModule">
<body ng-controller="vendorCtrl">
The version of Angular I am using is 1.2.25.
If anyone has any suggestions on how to ensure the proper execution of the function, it would be greatly appreciated!