Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $(function() {
- flowplayer(function(api) {
- console.log("Ready");
- // when a new video is about to be loaded
- api.on("load", function() {
- console.log("fp is about to load a new video with engine: " + api.engine.engineName);
- }).on("ready", function() {
- console.log("fp is ready to play the video " + api.video.duration + " seconds long");
- console.log("Resolution is: " + api.video.width + "x" + api.video.height);
- });
- console.log("FP Version: " + flowplayer.version);
- });
- $("#ModelSearch").autocomplete({
- source: function(request, response) {
- $.ajax({
- url: "scripts/getModels.php",
- dataType: "jsonp",
- data: {
- term: request.term
- },
- success: function(data) {
- response(data);
- }
- });
- },
- minLength: 1,
- select: function(event, ui) {
- console.log("Selected: " + ui.item.value + " aka " + ui.item.id);
- var lookup = {
- type: "Videos",
- id: ui.item.id
- };
- GetInfo(lookup);
- }
- });
- GetInfo = function(lookup) {
- if (lookup == null) {
- var lookup = { type: "Unseen" };
- }
- console.log("LOOKUP: " + lookup.type);
- if (typeof id != 'object') {
- switch (lookup.type) {
- case "Video":
- console.log("VIDEO LOOKUP: scripts/getinfo.php?type=Video&id=" + lookup.id);
- $.getJSON("scripts/getinfo.php?type=Video&id=" + lookup.id, function(data) {
- console.log(data);
- var items = [];
- $.each(data, function(key, value) {
- console.log("VIDEO LOOKUP: scripts/getinfo.php?type=Video&id=" + lookup.id);
- console.log(data);
- });
- });
- break;
- case "Model":
- $.getJSON("scripts/getinfo.php?type=Model=&id=" + lookup.id, function(data) {
- console.log(data);
- var items = [];
- $.each(data, function(key, value) {
- console.log("MODEL LOOKUP: scripts/getinfo.php?type=Model&id=" + lookup.id);
- console.log(data);
- });
- });
- break;
- case "Videos":
- $.getJSON("scripts/getinfo.php?type=Videos&id=" + lookup.id, function(data) {
- var items = data;
- popList(items);
- });
- break;
- case "Unseen":
- $.getJSON("scripts/getinfo.php?type=Unseen", function(data) {
- var items = data;
- popList(items);
- });
- } //end switch
- } else {
- console.log("lookup object contained nothing useful" + lookup);
- } //end if typeof
- } //end func Getinfo
- popList = function(items) {
- if (typeof items == 'object') {
- console.log("func: poplist");
- $("#videolist ul").empty();
- $.each(items, function(key, value) {
- listitems = $('<li class="ui-widget-content" id="' + value.id + '">' + value.video_name + '</li>').on('click', function() {
- console.log("Click: " + value.video_name);
- newVid(value.id);
- });
- $("#videolist ul").append(listitems);
- });
- }
- } //end func popList
- myRating = function(rating) {
- if (typeof id != 'object') {
- switch (lookup.type) {
- case "Video":
- console.log("VIDEO LOOKUP: scripts/getinfo.php?type=Video&id=" + lookup.id);
- $.getJSON("scripts/getinfo.php?type=Video&id=" + lookup.id, function(data) {
- console.log(data);
- var items = [];
- $.each(data, function(key, value) {
- console.log("VIDEO LOOKUP: scripts/getinfo.php?type=Video&id=" + lookup.id);
- console.log(data);
- });
- });
- break;
- case "Model":
- $.getJSON("scripts/getinfo.php?Model=&id=" + lookup.id, function(data) {
- console.log(data);
- var items = [];
- $.each(data, function(key, value) {
- console.log("MODEL LOOKUP: scripts/getinfo.php?type=Model&id=" + id);
- console.log(data);
- });
- });
- break;
- }
- } //end if typeof
- } //end myRating
- GetInfo();
- //loadPVR();
- newVid = function(vidID) {
- console.log("Func NewVID " + vidID);
- }
- console.log("FP Test: " + flowplayer.version);
- }); //Close jquery</script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement