播放歌曲作为网站开始 [英] Playing songs as website start

查看:66
本文介绍了播放歌曲作为网站开始的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个应用程序,声音需要在应用程序启动时播放,我在主页的主体内部使用了音频标签,但是当我们导航到另一个页面时,歌曲从头开始,我知道它因为母版页是每次都被召唤。是否有任何方法可以在整个应用程序中播放声音,即使在导航到其他页面后也无需重新启动歌曲。以及如何停止和重新启动该歌曲并为主页设置相同的音量



谢谢

Hi, I have an application where sound needs to be play as application start, I have used audio tag inside the body of master page but as we navigate to another page songs start from beginning, I know its because the master page is getting called everytime. Is there any way to play sound in whole application, without restarting the song even after navigating to other page. and how to stop and restart that song and setting volume of same for master page

THANKS

推荐答案

你将不得不使用'过时的'框架集标签(对我来说他们是最好的),把你的歌曲文件放在那些不变的页面,你应该没有问题。网页不需要是可见的,它可能只包含您的歌曲文件。



框架将页面划分为面板,每个面板由网页填充。在面板中单击链接时,它只会更改您单击的面板(可以更改该行为)。



因此,您应该有两个面板(frames):一个用于你的歌曲文件,另一个用于你的asp.net开发。



创建一个新的html文件并使用以下代码(将其命名为index .html或其他东西):

You'll have to use the 'obsolete' frameset tags (to me they're the best), put your songfile in those unchanging pages and you should have no problem. A webpage doesn't need to be visible, it may just contain your song file.

A Frameset divides the page into panels, each panel populated by a webpage. When a link is clicked in a panel, it only changes the panel you are clicking on (it is possible to alter that behavior).

Therefore you should have two panels ("frames"): one for your songfile, another one for you asp.net development.

Create a new html file and use the following code (name it index.html or something):
<html>
<head>
<title>This is the actual title people will see</title>
</head>
<frameset rows="0,*"><!-- with 0, the top page won't be visible -->
   <frame src="song_page.html"><!-- you'll need yet another html file for the song -->
   <frame src="My_ASP_Start_Page.aspx"> <!-- your asp.net start page -->
</frameset>
</html>





此页面必须成为项目的起始页面。请注意,没有正文标记。

song_page.html应该包含你的歌曲。



当用户与网站互动时,由song_page.html填充的上方面板不会改变,因为您的网站位于下方面板中。因此,歌曲文件不应该中断,因为它不在同一帧中。



This page must become your start page in the project. Notice there is no body tag.
The song_page.html should contain your song.

The upper panel populated by song_page.html will not change when users interact with the site, because your site is in the lower panel. Hence, the song file should never interrupt cause it is not in the same frame.


这篇关于播放歌曲作为网站开始的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆