<commit_before>package eu.ydp.empiria.player.client.controller.extensions.internal.media.html5;

import com.google.gwt.media.client.Audio;
import com.google.inject.Inject;

import eu.ydp.empiria.player.client.inject.Instance;
import eu.ydp.gwtutil.client.util.UserAgentChecker.MobileUserAgent;
import eu.ydp.gwtutil.client.util.UserAgentUtil;

public class HTML5AudioMediaExecutor extends AbstractHTML5MediaExecutor<Audio> {

	private final Instance<IosAudioPlayHack> iosPlayHack;
	private final UserAgentUtil userAgentUtil;

	@Inject
	public HTML5AudioMediaExecutor(Instance<IosAudioPlayHack> iosPlayHack, UserAgentUtil userAgentUtil) {
		this.iosPlayHack = iosPlayHack;
		this.userAgentUtil = userAgentUtil;
		applyIosHckIfNeeded(userAgentUtil);
	}

	private void applyIosHckIfNeeded(UserAgentUtil userAgentUtil) {
		if (isPlayOnTouchHackNeeded(userAgentUtil)) {
			addIosAudioHack();
		}
	}

	private boolean isPlayOnTouchHackNeeded(UserAgentUtil userAgentUtil) {
		return userAgentUtil.isInsideIframe() && isMobileSafari(userAgentUtil);
	}


	private boolean isMobileSafari(UserAgentUtil userAgentUtil) {
		return userAgentUtil.isMobileUserAgent(MobileUserAgent.SAFARI) || userAgentUtil.isMobileUserAgent(MobileUserAgent.SAFARI_WEBVIEW);
	}

	@Override
	public void initExecutor() {
		//
	}

	@Override
	public void setMedia(Audio media) {
		super.setMedia(media);
		applyIosHckIfNeeded(userAgentUtil);

	}
	protected void addIosAudioHack() {
		iosPlayHack.get().applyHack(this);
	}

}
<commit_msg>YPUB-5522 - Formatting fixes during review<commit_after>package eu.ydp.empiria.player.client.controller.extensions.internal.media.html5;

import com.google.gwt.media.client.Audio;
import com.google.inject.Inject;

import eu.ydp.empiria.player.client.inject.Instance;
import eu.ydp.gwtutil.client.util.UserAgentChecker.MobileUserAgent;
import eu.ydp.gwtutil.client.util.UserAgentUtil;

public class HTML5AudioMediaExecutor extends AbstractHTML5MediaExecutor<Audio> {

	private final Instance<IosAudioPlayHack> iosPlayHack;
	private final UserAgentUtil userAgentUtil;

	@Inject
	public HTML5AudioMediaExecutor(Instance<IosAudioPlayHack> iosPlayHack, UserAgentUtil userAgentUtil) {
		this.iosPlayHack = iosPlayHack;
		this.userAgentUtil = userAgentUtil;
		applyIosHackIfNeeded(userAgentUtil);
	}
	
	@Override
	public void initExecutor() {
		//
	}
	
	@Override
	public void setMedia(Audio media) {
		super.setMedia(media);
		applyIosHackIfNeeded(userAgentUtil);
	}

	private void applyIosHackIfNeeded(UserAgentUtil userAgentUtil) {
		if (isPlayOnTouchHackNeeded(userAgentUtil)) {
			addIosAudioHack();
		}
	}

	private boolean isPlayOnTouchHackNeeded(UserAgentUtil userAgentUtil) {
		return userAgentUtil.isInsideIframe() && isMobileSafari(userAgentUtil);
	}


	private boolean isMobileSafari(UserAgentUtil userAgentUtil) {
		return userAgentUtil.isMobileUserAgent(MobileUserAgent.SAFARI) || userAgentUtil.isMobileUserAgent(MobileUserAgent.SAFARI_WEBVIEW);
	}
	
	protected void addIosAudioHack() {
		iosPlayHack.get().applyHack(this);
	}

}

{'fraction_non_alphanumeric': 0.09147745969068773, 'fraction_numerical': 0.003948667324777887, 'mean_word_length': 6.469287469287469, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1896801', 'n_tokens_mistral': 1085, 'n_tokens_neox': 1041, 'n_words': 148}