Easy Templates HTML5 question?

Hi all, sorry if this is in the wrong section, tried it on the off topic with no reply?

I was wondering if anyone can help? I have a website set up. It was a templet purchased from easytemplates. The problem i have is… I have background music playing on the site. when you click on a video to play, the back ground music continues to play and does not stop? I have used these templates before without any problems, but this is a new HTML5. In previous templates the background music automatically stops and restarts when you play the video. any ideas?

I did contact easytemplates for advice, their tech team replied (Yes, delete the .mp3 file from the server) surely this does away with the back ground music altogether? Thank you in advance. Andy

http://www.ctmstudio.co.uk


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

There is a button at the bottom of the page to turn the background music on
and off. Does that not help?


Ernie Simpson

On Wed, Sep 12, 2012 at 10:57 AM, Andy email@hidden wrote:

Hi all, sorry if this is in the wrong section, tried it on the off topic
with no reply?

I was wondering if anyone can help? I have a website set up. It was a
templet purchased from easytemplates. The problem i have is… I have
background music playing on the site. when you click on a video to play,
the back ground music continues to play and does not stop? I have used
these templates before without any problems, but this is a new HTML5. In
previous templates the background music automatically stops and restarts
when you play the video. any ideas?

I did contact easytemplates for advice, their tech team replied (Yes,
delete the .mp3 file from the server) surely this does away with the back
ground music altogether? Thank you in advance. Andy

http://www.ctmstudio.co.uk


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Hi Ernie, No.
What i need is the background music to play. But when someone clicks to play a video the background music automatically stops.


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Hi andy,
I took a brief look at this earlier and the template uses the jQuery JWPlayer plugin to play both the sound and video. In theory you should be able to do something like this to stop the background music on the videos section;

$("#jquery_jplayer").jPlayer("stop")

The issue is really linked to the template and I would suggest pushing back on the people you purchased it from as they should be able to provide some support on the issue. I say should as there are a lot of template sites that sell templates from other sources and most won’t have an idea on how things are constructed. Also I’d be surprised if you get a solid answer from this list as the issue isn’t related to Freeway in any way that I can see.
Regards,
Tim.

On 12 Sep 2012, at 16:27, Andy wrote:

What i need is the background music to play. But when someone clicks to play a video the background music automatically stops.


Experienced Freeway designer for hire - http://www.freewayactions.com


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Hi Tim,
Thanks for that, Im not sure where this would need to be added?
I backed up the main.js file and tried replacing: (‘js/jquery.jplayer.min.js’);

Do you think this was the right place to ad it?

Thanks again Andy


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Forgot to mention, that didn’t work. the website wouldn’t load.


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Do you think this was the right place to ad it?

No - definitely not.

Should probably be added in the ‘jquery.jplayer.min.js’ file somewhere.

D


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Thanks Dave,
Just had a quick look at the file you mentioned Wow! way beyond me! I can’t make any sense of any of it. I think im just going to have to diable the background music. Unless some one fancies a glance at the file and giving me a clue?
I’ve uploaded a copy of the file here if someones up for it?

http://www.c-t-m.co.uk/test/jquery.jplayer.min.js

Thnk you in advance, Andy


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Just for your future reference, any time you see .min. in a filename, that means it has been minimized.

Code is written in human-readable terms so that human programmers can understand what is going on at any given point in the program. Computers don’t need you to spell things out to that degree. As long as you don’t repeat yourself, you can use a, b, c, d for variable names, function names, whatever you may need. Ditto for line-breaks and other white space. The computer will keep it straight. This sort of thing is done automatically by a separate program, usually as a means of making the finished and debugged program as tiny as possible to save download bandwidth. It’s not meant to be read or altered after this process has taken place.

If you downloaded this file as a part of a code package, then you probably got the un-minimized version along with it. Look in the package and see if there is a separate folder containing files with the identical name – but minus the .min. part. That’s what you would want to hack on, and then run the result through the minimizer again.

Walter

On Sep 13, 2012, at 8:53 AM, Andy wrote:

Thanks Dave,
Just had a quick look at the file you mentioned Wow! way beyond me! I can’t make any sense of any of it. I think im just going to have to diable the background music. Unless some one fancies a glance at the file and giving me a clue?
I’ve uploaded a copy of the file here if someones up for it?

http://www.c-t-m.co.uk/test/jquery.jplayer.min.js

Thnk you in advance, Andy


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Thanks Water,
I had to read that a couple of times before i understood what you meant, sorry mind block! Anyway …

I had a look through the files and found a file called script.js
I found this part (copied and pasted) see below

///////////////////

$(document).ready(function() {
////// sound control
$("#jquery_jplayer").jPlayer({
ready: function () {
$(this).jPlayer(“setMedia”, {
mp3:“music.mp3”
});
//$(this).jPlayer(“play”);
var click = document.ontouchstart === undefined ? ‘click’ : ‘touchstart’;
var kickoff = function () {
$("#jquery_jplayer").jPlayer(“play”);
document.documentElement.removeEventListener(click, kickoff, true);
};
document.documentElement.addEventListener(click, kickoff, true);
},

	repeat: function(event) { // Override the default jPlayer repeat event handler				
			$(this).bind($.jPlayer.event.ended + ".jPlayer.jPlayerRepeat", function() {
				$(this).jPlayer("play");
			});			
	},
	swfPath: "js",
	cssSelectorAncestor: "#jp_container",
	supplied: "mp3",
	wmode: "window"
});

I tried replacing the bit script that Tim had mentioned (12th line down), but the page failed to load. I guess i’m still doing things wrong.
I would appreciate any help.
Thanks Andy.


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Sorry now that ive uploaded it, its line 5
Andy


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

I’m not sure how you would get a handle to the player from another script, as this script is written in an anonymous function (closure) style. It deliberately doesn’t expose any global variables to be tinkered with. Also, this script only encloses the audio functionality. Your video player is probably wrapped in a separate function, and is similarly isolated.

There’s a couple of ways I might approach fixing this. The quick and dirty way would be to declare a global variable, like window.players = [], and then inside both players, append a handle to each player to that array:

window.players.push($(this).jPlayer); //not sure if this is correct, you'd need to fiddle

Then, in either of the players, you could first go through all the players in the global array and stop them:

for(var i=0; i < window.players.length; i++){
	window.players[i]('stop');
};

…before issuing a (‘play’) command to the current one.

The more correct and “Prototype” way to do this would be with synthetic events (note – this is completely made-up code, and relies on the Prototype.js synthetic events; jQuery may have something similar but I’m not at all familiar with that library):

//somewhere in your player functions
this.observe('players:stop', function(evt){
	this.stop();
});
//inside the start playing method
this.fire('players:stop'); //stops all players, even self
this.play(); //start this player

jQuery isn’t really my bag, so I can’t help you much further than this.

Walter

On Sep 13, 2012, at 12:13 PM, Andy wrote:

Sorry now that ive uploaded it, its line 5
Andy


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options