2017-04-22 68 views
0

您好我有以下代碼運行我的主頁爲我的網站,但每當我啓動該網站時,嵌入部門的音頻開始播放,並破壞網站,所以我想知道是否有任何屬性,我可以在嵌入標籤,它會讓它不開始播放音頻,或者如果有任何其他方式來解決這個問題,你會知道?如何讓一個嵌入部門不開始播放音頻

<!DOCTYPE html> 
<html lang="en"> 
<head> 
    <link rel="icon" href="Images/favicon-16x16.png" type="image/png"> 
    <title>Web Portfolio: Patrick White's Index Page</title> 
    <style> 
    body { 
    font-size: 1.1em; 
    font-weight: bold; 
    font-family: Century Gothic, Sans-serif; 
    color: #02849D; /*dark navy blue*/ 
    text-align: left; 
    /*Personal Addition*/ 
    background-image: url("Images/Black_Rainbow.jpg"); 
    background-size: 1900px 1400px; 
    background-repeat: no-repeat; 
    } 
    h1 { 
    font-size: 1.8em; 
    font-weight: bold; 
    color: #02849D; 
    text-align: center; 
    } 
    a:link { 
    color: #31AEC5; 
    } 
    a:visited { 
    color: #015261; 
    } 
    a:hover { 
    color: #505050; 
    } 
    #divembed { 
    float: right 
    } 
    .button { 
    background-color: #707070; /*grey*/ 
    border: none; 
    color: #02849D; /*bright blue*/ 
    width: 450px; 
    height: 75px; 
    text-align: center; 
    line-height: 75px; /*centers the text vertically*/ 
    text-decoration: none; 
    display: inline-block; 
    font-size: 1.1em; 
    font-family: Century Gothic; 
    font-weight: bold; 
    } 
    </style> 
</head> 
<body> 
<div> 
    <a href="#main">Skip to main content</a> 
    </div> 
    <h1>Patrick White Web Portfolio</h1> 
    <div id="divembed"> 
    <a href="http://www.gamesembedcode.com/2011/07/tennis-flash-game.html"></a> 
    <embed src="http://www.freegaming.de/components/flash/7196382252.swf?affiliate_id=941efa0f97e566c4" quality="high" bgcolor="#e8ffff" width="480" height="480" menu="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"> 
    </div> 
    <div> 
    <ul> 
     <li>Patrick White</li> 
     <li><a href="mailto:[email protected]">[email protected]</a></li> 
     <li>843-653-3474</li> 
     <li>link to one of my favourite <a href="http://eelslap.com/" target="_blank">websites</a></li> 
     <li>If you like goats, download my presentation! In either: <a href="Images/GOATS.pdf" download>PDF</a>, <a href="Images/GOATS_VIDEO.wmv" download>Video</a>, <a href="Images/GOATS.odp">Open Office</a> or <a href="Images/GOATS.ppt">Microsoft Powerpoint</a></li> 
    </ul> 
    </div> 
    <div> 
    <ul> 
     <li>I.T. 9 (1-2)</li> 
     <li>Mr. Gabriel Jones</li> 
     <li>Web Design</li> 
     <li><a href ="http://go.vsb.bc.ca/schools/pointgrey/Pages/Default.aspx" target="_blank">Point Grey Secondary</a>, 2016-2017</li> 
    </ul> 
    </div> 
    <nav> 
    <ul> 
     <li><a href="index.html">Home</a></li> 
     <li><a href="Accesibility.html">Accessibility</a></li> 
     <li><a href="Usability.html">Usability</a></li> 
     <li><a href="Graphics.html">Graphics</a></li> 
     <li><a href="JavaScript.html">JavaScript</a></li> 
     <li><a href="Tools.html">Tools</a></li> 
     <li><a href="Video.html">Video</a></li> 
    </ul> 
    </nav> 
    <main id="main"> 
    <p>This web portfolio includes examples of my works in Mr. Jones' Web Design class. It also includes my reflections (below) in what I learned with each unit of the course.</p> 
    <h2>Unit 2</h2> 
    <p>In this section, I learned the basics of a fundamental scripting language for website design; <i>HTML5</i>. I learned about some of the many tags that are useful in the design of websites that will assist me in my prospective career in web design. In this unit I was presented with many resources to ensure that my HTML code was formatted correctly and was error-free, in the form of online generators. We also learned a great deal about how to incorporate links and images into our file, of which I found particularly interesting. In this section we learned a lot about how to input the actual content of our websites, and I am very excited for the future units in which we get to further design this content to seem visually appealing.</p> 
    <h2>Unit 3</h2> 
    <p>This section will be completed soon</p> 
    <h2>Unit 4</h2> 
    <p>This section will be completed soon</p> 
    <h2>Unit 5</h2> 
    <p>This section will be completed soon</p> 
    <h2>Unit 6</h2> 
    <p>This section will be completed soon</p> 
    <h2>Unit 7</h2> 
    <p>This section will be completed soon</p> 
    </main> 
    <a href="http://www.coolmath-games.com/0-me-and-the-key" target="blank" class="button">Click to Play One of My Favourite Games!</a> 
</body> 
</html> 

回答

0

它似乎並不像這是不可能的,除非你有機會到SWF源,至少根據這個老的回答帶着一顆破碎的鏈接到Adobe:Disabling sound of embedded flash object with html。如果是你的遊戲,我強烈建議你在那裏進行調整,而不是在頁面中進行調整。更改源代碼(或向開發人員要求)是最值得推薦的解決方案。

大部分內容都是爲瀏覽器擴展用戶提供的關於將頁面靜音的建議,如果您沒有源代碼但專門用於包含遊戲,則可以推薦。本文涵蓋了Chrome,Firefox和Opera:http://www.makeuseof.com/tag/mute-sound-webpages-embedded-audio-flash/

這可能是我在該主題上找到的最深入的交流:https://www.experts-exchange.com/questions/26480933/Ho-to-disable-audio-of-the-SWF-file-in-Java-Script-HTML.html。建議指定不同的播放器可能允許您成功將「音量」參數更改爲「0」或「靜音」參數爲「真」。我不能說出他們爲你的目的推薦的球員的效力,但他們被包含在最後一個鏈接中。

最後一個人中還包括一個「autoplay」參數,在他的例子中它被設置爲「false」。我認爲這可能無法解決你的問題,因爲即使包含了這些麻煩,他也會遇到類似的麻煩,但試試它並不會造成傷害。

+0

好的,謝謝你的迴應!你知道是否有辦法有效地從HTML文件中刪除所有音頻,導致這種情況?因爲我實際上並不需要文檔上的任何音頻 – Spatrico

+0

如果在這種特定情況下有任何方法,我找不到它。我對這個東西比較陌生,所以一定要繼續尋找。 – Raj

+0

就html而言,不同的瀏覽器可以用幾種不同的音頻格式做不同的事情:https://www.w3schools.com/tags/tag_audio.asp。可接受格式化的音頻(或視頻)內容可輕鬆使用這些工具,但閃光燈不同。 Afaik將改變Flash遊戲的行爲方式(在啓動時將其音頻靜音,添加靜音按鈕/音量滑塊等),您必須直接修改其源文件,或讓遊戲開發人員執行此操作。如果它有幫助,那麼私密用戶通常會在瀏覽器中限制Flash,但可能通常是爲了避免你想要避免的內容。 – Raj

相關問題