Dynamic loading videos - how to integrate data from json files in video placeholder at the stage

Hello!


Working on a site where I want to display a variety of videos. Found a tutorial with a good script for loading dynamically the contents of a json file.

$.getJSON ("data / press.json", function (data))

{

for (var i = 0; i < data.length; i ++)

{

var s = sym.createChildSymbol ("slide", "Stage");

s.$("photo"). CSS({"background-image":"URL('"+Data[i].image+"')"});)

s.$("title").html (Data [i] .title);

s.$("headtext").html (Data [i] .headtext);

s.getSymbolElement () .css ({"location": "absolute",})

"the left": "50px",

({'top': I * 200 + 50 + 'px'});

}


The json file content looks like this,


[

{

'image': "images/poster_.jpg,"

"title": "my test."

"date': 'my date."

"headtext": "my text",

'video': "http://www...".

},

]


Unfortunately, there is nothing of video in the above script.

Anyone know how I can,


1 / choose my "video" variable data in my json file (guess the script needs a line like: s.$("video").html (data [i] .video);)     or something)

2 / dynamically put in my video placeholder where my video script of the show is.

-----

YouTube var = $("< iFrame/>");

var url = " " https://www.YouTube.com...; "


SYM.$("video"). Append (YouTube);

YouTube.attr ('type', ' text/html');

YouTube.attr('width','640');

YouTube.attr('height','360');

YouTube.attr ('src', URL);

-------

Most grateful for any advice

Best regards

Bengt, informel.se

Looking at the code of the success of your JSON Manager, it seems that you want to create a list of these items on stage with several video clips too. You can create the iframes required in success of the JSON Manager and set the src attribute according to the video attribute of the incoming JSON data. An approach could be as follows:

$.getJSON ("data / press.json", function (data))

{

for (var i = 0; i)

{

var s = sym.createChildSymbol ("slide", "Stage");

s.$("photo"). CSS({"background-image":"URL('"+Data[i].image+"')"});)

s.$("title").html (Data [i] .title);

s.$("headtext").html (Data [i] .headtext);

s.getSymbolElement () .css ({"location": "absolute",})

"the left": "50px",

({'top': I * 200 + 50 + 'px'});

Assuming that you have a video called placeholder in the slide of symbol

var YouTube is $("").attr('width','640').attr('height','360');.

YouTube.attr ('src', Data [i]. Video);

s.$("video").html (YouTube);

}

}

Tags: Edge Animate

Similar Questions

  • How to move data from flat file to the repository of execution

    Hi all

    We have 2 instances

    1. development - we are able to move the data from flat file to target the DB using scenario1.

    The files are in 04 who's ODI installation box


    2. enforcement Repo

    to scenario1 execution repo installed in ODI 07 which is ODI installation box
    but not able to move the data from flat file to target DB.

    We get an error - file not found.

    File is located in the box 04.

    My question is that what is the best process to make scenario1 course migrated to work.

    Appreciate your help.

    I wanted to say that in view of the dev and prod in the Prod repository agent is not a good idea.

    Ideally, in repo Prod, you must have prod 07 agent.

    In Dev Repo, you shouldn't have dev 04 agent

    makes sense

  • How do root data from php file using local host in as3?

    I really sowie coz my English are bad.now I want to the root of the phpfile use localhost in action script adobe flash pro... can u give me some example and explanation

    I'm using json array data in my php

    Your PHP returns JSON, right? Take a look at the URLLoader class in the documentation to know how to load the data from a URL. Once the data is loaded, you need to decode it to AS3 object. Use JSON of Mike Chambers' library https://github.com/mikechambers/as3corelib

    --

    Kenneth Kawamoto

    http://www.materiaprima.co.UK/

  • How to read data from several files and add columns in a single file

    Hi guys,.

    I have a problem in adding data from files in different columns. I have the attachment a file A and B which I am reading and not able to get the data in the Result.txt file. Please give your opinion on how can I do this

    You must add the data of all files before proceeding with a single entry.

  • How to recover data from vhd file created in windows system image upwards.

    Yesterday, my computer Dell Laptop Inspiron 14 R did not start & Finally, I had to format the drive. I see a windows image backup .vhd files. These files contain the data from my laptop, which has been deleted during formatting. Can I get it back?

    Hello

    What operating system is installed on the computer?

    Perform the steps suggested by Karena R from the link below, if you have Windows 7 installed and see if it helps.

    http://answers.Microsoft.com/en-us/Windows/Forum/Windows_7-system/how-to-restore-vhd-file-backup/f3ed3ca5-3079-40CD-A959-835caeba80a7

    Hope this information helps.

  • How to copy data from one hard drive to another after the upgrade?

    I have a HP e9220y, and I recently bought a new hard drive for it. There is nothing wrong with the former, but this one has a 64 MB cache and 7200 RPM so I hope it will be a little faster. I installed it and it works fine, but I want to copy all data from the old disk to the new so I can start everything off the faster hard drive and I seem to have a bit of doing wrong. I can't just copy and paste because of the Windows system files that are used. And last night when I set up Windows backup, and went to bed, when I thought it that Windows has recovered from a stop unexpected, rebooted, and only 2 GB of data saved obtained.

    What is the best way to move all the data from the old drive to the new drive, make it the default C: drive and move partitions system and factory_image as well? Thank you!

    Please read this link to another post made by Big_Dave and myself

    http://h30434.www3.HP.com/T5/desktop-hardware/hard-drive-imminent-failure-problem/TD-p/438567

    (1) If your old drive and the new drive is Seagate or Western Digital, then free House with their cloning software.

    (2) before starting the clone process, I found best to perform a disk cleanup and defragmentation.

    Cloning software to copy the two partitions. Example:

    Old drive 250 GB formatted to 232 C: created 220 and 12 GB D:

    New 1000GO drive formatted to 931 GB created 919 GB C: and D: to 12 GB

    The "Seagate disc Wizard" cloning software will let create you a clone automatic or manual partition resizing.

    The two modes to offer an overview of the actions before commit you. The manual on this page of Seagate (PDF) is 68 pages.

    After the cloning process he complete, all you have to do is swap on the disks. Besure to connect your new disc on the original motherboard SATA port.

  • How to import data from CSV files to IOM?

    Hello
    We have to import some files in the csv format and are set up in a specific folder hierarchy. Please help as I am not able to go further.

    Thank you very much!

    So you mean, you want to create users in the IOM based on the data contained in these files...
    Then, you should probably create GTC file connector to consume your CSV file and create users in the IOM.

    Thank you
    Suren

  • How to read data from a worksheet to a chart in the form of wave at intervals to simulate real-time data

    Hi I have measured data using a SELF-DIAGNOSIS device and that you have downloaded the log files as a .csv I have attatched below.  I'm trying to read the 7th column of data (RPM) and display it on a waveform graph, read line-by-line to simulate driving real-time data. The interval between readings, I'm trying to achieve is 500 Ms because it is the time interval of readings on the worksheet. I'm finishing the two loops when rpm is equal to zero, as happens when the car is off. I have attatched the relevant section of my program below. Any suggestions would be greatly appreciated.

    Thank you

    Michael

    There are two errors in your block diagram.  First of all, as you read the entire table 2D in all at once (which is fine), you make a clumsy (pardon my language) job to make a line of programming.  Once you take the first line of headers, you have the ideal substrate for a loop, which is made of elements of an array (lines) process, one at a time, using its tunnel of indexation.

    The second mistake is to forget data flow.  The loop, I mentioned, or the While loop you use, produced one at a time and points it at 2 Hz thanks to your expectation of 500msec.  You want to give each point to your chart, but the picture is out of the loop, which means that there is No point until the loop ends.

    Here's an easy Question - where you put the indicators in table of waveform?  [Council - I said that "outside the loop is bad"].

    Bob Schor

  • How to import data from CSV file in a table using oracle forms

    Hello

    I have a CSV file and I want to insert in the oracle database in a table by using a button under forms of oracle.
    the user can select the CSV file by using the open dialog box.
    can someone help me find the method to import and select the client machine file?

    THX.

    You want to import the contents of the file or the file itself? I assume that you want to import the contents of the file. For this, there are really only two options to make an Excel (.csv) file and import into shapes; WebUtil or a JavaBean. Some examples of both:
    WebUtil: How to read an Excel file in a form of Oracle
    Oracle is CJP/BEAN - project Excel

    Try them both and see which works best for you.

    Craig...

  • How to recover data from textfield, select location and fill in the data of another textfield

    I want to be able to enter a number or text in a field, and then select a location for the data to be placed in the world based on the selected location

    Here's a form Im trying to get to work.

    http://www.myschooljacket.com/OutputLocation.PDF

    Thanks for any help you can lend.

    OK I've got get it now... is your modified sample.

    Paul

  • How to export data from flat file with ODI DB?

    We want to export flat files DB2 tables.
    Who can tell me how to do it with ODI?
    Please give me a simple example or steps.
    Thank you.

    There are two ways

    Either use IKM Sql to add files

    (or)

    OdiSqlUnload
    For OdiSqlUnload, you can use this technique to provide the connection parameters - http://odiexperts.com/?p=1985

  • How to transfer data from an old laptop (broken screen) to a new laptop

    How to retrieve data from an old laptop, to transfer to the new laptop. the problem is that the screen is broken on the old portable th.

    From Internet Explorer

    Original title: data transfer

    The easiest way would be to put his HARD drive in a box that connects to the computer by USB.

    This is just an example - http://www.amazon.co.uk/Hard-Drive-Caddy-Case-Enclosure/dp/B003MVW2SM

    You probably have a 2.5 HDD "because I know that all laptops do.  If you need to buy an enclosure for a 2.5 drive "[not a disk 3.5" that could come from a desktop computer].

    Almost all cases derive the power to drive the HARD drive to the USB itself [rather than an external power].  If you see one that needs an external power supply, then you are probably looking to the wrong thing.

    You need to know if the HARD drive is IDE or SATA.  It depends on the age of the computer.  Your computer's manual should tell you or you can whip the HARD drive just to have a look.

  • Acquire data from a file using a dialog popup on a stamp object tabs-delimited

    I'm trying to import data from a file delimited by tabs using a dialog popup on a stamp object.  I bought the book by Thom Parker -all on the stamps of the PDF in Acrobat and paperless workflow and have worked through the examples in the Appendix.

    My problem is to understand how to integrate the data in the object of the file dialog box.

    I'm not plagiarizing his book - so am elect at this time is not to justify my code.  The script reads the file, by simply providing only not in the accounts rendered file so that I can choose which line to import into the stamp.

    I typed in the code exactly how the book described, but when the popup dialog object is selected, there is nothing in the menu dropdown.  When I click OK, the first record is placed on the stamp - except for the fields that I am eager to appear in the popup box object dialog box.

    I searched the forums, as well as the JavaScript reference.  There are examples of popup dialog object, but none of them show how to import data from a file - just for the items to be of type in the list.

    Any help would be greatly appreciated!  I tried to work on this for several months now.

    I got the files directly from tdjohnson7700. Here are my findings:

    There are two problems with your files:

    You reference an object of 'Dialogue', even if you declared as 'dialogue' - JavaScript is case-sensitive, so you must use the lowercase version.

    And then you have an additional column of data in your text file, Acrobat doesn't like it and reports an error. You can see when you use the tools > forms > Forms Options more > function to import data to import data from your text file. You must either add a form field named "last" to your stamp, or you need to remove this column from the text file. After these two changes, the stamp works.

  • How to migrate data from a source to multiple targets (tables)?

    How to migrate data from a source to multiple targets (tables)? Describe the General steps, please or point me to a tutorial

    Yes, a table in a mapping element can be source and target at the same time (i.e. a target can be reused as a source for the rest of the map on the right side of the table).

    Don't forget to check the order of loading (in the property map), to ensure that the reused as source is loaded before the final table target table.

    I tested it and it works. However, the documentation is not said in the link I gave you above:

    "Each element of data store that has entries but no exits in the logical diagram is considered a target."

    Usually, I tend not to do. I am in favour of a Divide and Conquer approach and try to have my mapping as simple as possible. It is easier to debug and maintain.

  • How to recover data from table

    I'm new to APEX 4.0, how to recover data from table

    My table is CR_USERPROFILE... and I want to recover data to the following recommendations:

    Select the title, user name, address, email, mobile, cr_userprofile where e-mail is APEX_CUSTOM_AUTH. GET_USERNAME


    Text P110_EMAIL 10 field
    20 P110_TITLE selection list
    P110_USERNAME 30 text field
    Text field P110_ADDRESS 40
    P110_PHONE 50 text field
    Text P110_MOBILE 60 field

    could any body if you please help...

    Thanks and greetings
    Luke

    Hello

    1. create the process Page.
    2. Select the Data Manipulation
    3. in the category select "Automated line Fetch".
    4 enter the process name, sequence, select "on the load - before the headers" to the point.
    5. specify the owner, table, primary key and the key column primary (Item name contains the primary key).
    6. create a process.
    7. in each element, select "Column of the database" in "the Source Type.

    Kind regards

    Patel Kartik
    ------------------------------------------------------------------------
    http://patelkartik.blogspot.com/
    http://Apex.Oracle.com/pls/Apex/f?p=9904351712:1

Maybe you are looking for

  • change the key of the synchronization

    I changed my recovery Firefox sync 26 digit key on my laptop.Now, I want to update my recovery or key of the pair as a new device my nexus android 4 which had Firefox and is synchronized with my old key recovery.How do I do that?Thank you.

  • Satellite C650D - could not turn on

    2 months new Toshiba Satellite C650D, system could not supply using batteries or AC adapter / CC. All tips for solving problems? Thank you

  • Phone call from pirate

    Saturday, I received a phone call from a guy who claims to be a MS tech.  Said my computer was infected by the virus and has been ready to send malicious virus anywhere on the internet.  He actually gave me what he claimed, it was my computer ID... w

  • The port adapter driver prolific PL2303 USB-to-Serial fails to install

    I am installing a cable adapter USB - to - Serial-PL2303 prolific port 1 '. This is done by cutting. It seems that many people have not all the problems, and they have XP, Vista and Win7 drivers available for it. I downloaded the latest installer for

  • When I turn on my computer Windows 7, I'm frozen screen

    I have windows 7.  Lately when I turn on the computer everything is ok until I log in, then the screen opens and displays all my icons but remains frozen and nothing works.  Heelllp!