我使用引導模式彈出顯示音頻/視頻附加在項目中。 點擊取消按鈕時,模式應該關閉,音頻應該停止播放。 這是在Chrome中正常工作,但在Mozilla和IE中,我點擊取消模式解散,但aduio /視頻繼續播放。引導模式的數據關閉關閉模式不關閉音頻在mozila和IE
這是模式彈出的HAML代碼:
%a{ href: "#", class: "x", title: "Close", :'data-dismiss' => "modal" }
.diagRepeater
= swf_tag "StrobeMediaPlayback",
:width => '620',
:height => (attachment.media_content_type.split('/')[0] == 'audio' ? '65' : '340'),
:flashvars => { :urlIncludesFMSApplicationInstance => "true",
:src => URI.encode("#{request.protocol}#{request.host_with_port}" + attachment.media.url),
:playButtonOverlay => (attachment.media_content_type.split('/')[0] == 'audio' ? 'false' : 'true'),
:controlBarAutoHide => (attachment.media_content_type.split('/')[0] == 'audio' ? 'false' : 'true') },
:parameters => { :allowFullScreen => "true", :wmode => "direct", :allowScriptAccess => "always" }
這是bootstrap.js文件中的代碼:
hide: function (e) {
e && e.preventDefault()
var that = this
alert(this.toString());
e = $.Event('hide')
this.$element.trigger(e)
if (!this.isShown || e.isDefaultPrevented()) return
this.isShown = false
$('body').removeClass('modal-open')
escape.call(this)
this.$element.removeClass('in')
$.support.transition && this.$element.hasClass('fade') ?
hideWithTransition.call(this) :
hideModal.call(this)
}
當您關閉模式時,您可以對視頻調用動作來停止播放。 – kobaltz 2013-03-09 04:32:07
如何做到這一點,你可以請解釋一下 – User16119012 2013-03-09 05:05:16