Construct the src in a javascript tag from node fields
You can do this in a node.tpl.php file in your theme or to be specific to one content type.  

Duplicate the default node.tpl.php file found in /modules/node/ and rename it to node-NODETYPE.tpl.php NODETYPE being the machine name of the node which you can find at structure -> content types, in the CMS. 

Install the devel module and enable it, then do a dpm($node); in your copied node.tpl.php file to get the variables you need. Of course you would need to have a custom theme so it doesn't get overridden on an update.

To do this in a module you'd need be somewhat familiar with hooks.

And since the dpm is called after the output is rendered you need to reload the page twice.
Don't forget to clear cache after you add in the node.tpl.php to your theme.