0
File.prototype.OpenAudioFile = function(dPath)
{
	var rem = document.createElement("div")
	rem.name = "divv";
	rem.id = "divId";
	
	rem.innerHTML = '<embed src="' + dPath + '" autostart="false" name="' + dPath + '"></embed>';

	document.body.appendChild(rem);
}

I'm using the way above to solve my sound problem but when i attach div object to document sound plays automaticly.is there any solution for it?

by the way, im not working on internet browsers, it's a part of a framework for tv. it supports js 1.2.

3
Contributors
3
Replies
4
Views
7 Years
Discussion Span
Last Post by Troy III
0

i write to create <embed> object using document.write but as i read document.write isnt supported by our middleware yet and im trying to find different ways to load and play sounds. can you tell me how to load and play sounds dynamicly?

0

i write to create <embed> object using document.write but as i read document.write isnt supported by our middleware yet and im trying to find different ways to load and play sounds. can you tell me how to load and play sounds dynamicly?

Put the <embed> element in your code - no need to create it through javascript - and leave its source string empty!
Than you can set its source by user action that will trigger a simple function that will assing the address to the file yoou like.

p.s.:
Consider using "object" instead of "embed'.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.