CN112579039A - Method and equipment for automatically playing audio of H5 page based on WeChat - Google Patents
Method and equipment for automatically playing audio of H5 page based on WeChat Download PDFInfo
- Publication number
- CN112579039A CN112579039A CN202011560026.3A CN202011560026A CN112579039A CN 112579039 A CN112579039 A CN 112579039A CN 202011560026 A CN202011560026 A CN 202011560026A CN 112579039 A CN112579039 A CN 112579039A
- Authority
- CN
- China
- Prior art keywords
- audio
- file
- playing
- automatic
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 12
- 238000012544 monitoring process Methods 0.000 claims abstract description 10
- 230000006870 function Effects 0.000 claims description 7
- 238000004590 computer program Methods 0.000 claims description 3
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000010586 diagram Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 230000001960 triggered effect Effects 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/16—Sound input; Sound output
- G06F3/165—Management of the audio stream, e.g. setting of volume, audio stream path
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/445—Program loading or initiating
- G06F9/44505—Configuring for program initiating, e.g. using registry, configuration files
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Software Systems (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Multimedia (AREA)
- Health & Medical Sciences (AREA)
- Audiology, Speech & Language Pathology (AREA)
- General Health & Medical Sciences (AREA)
- Human Computer Interaction (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
According to the method and the device for automatically playing the audio of the H5 page based on the WeChat, the JS-SDK file of the WeChat is introduced into the HTML 5; acquiring an audio file to be played, and executing a first configuration file in the WeChat; and monitoring through a second configuration file in the WeChat to finish the automatic playing of the audio file, so that the automatic playing of the audio file is realized in the iOS terminal, and the user experience is improved.
Description
Technical Field
The invention relates to the technical field of computers, in particular to an automatic audio playing method based on an H5 page of WeChat.
Background
The mobile terminal H5 is usually developed to meet the requirement of automatic audio playing, such as automatic playing of background music/listening book function in the incoming page. The android mobile phone browser can directly support automatic audio playing, but the iOS platform cannot automatically play audio when a user does not perform any operation due to safety considerations.
Disclosure of Invention
Technical problem to be solved
In order to solve the above problems in the prior art, the method for automatically playing the audio of the H5 page based on the WeChat provided by the invention can realize the automatic playing of the audio file in the iOS terminal, thereby improving the user experience.
(II) technical scheme
In order to achieve the purpose, the invention adopts a technical scheme that:
the method for automatically playing the audio of the H5 page based on the WeChat comprises the following steps:
s1, introducing the WeChat JS-SDK file into HTML 5;
s2, acquiring an audio file to be played, and executing a first configuration file in the WeChat;
and S3, monitoring through a second configuration file in the WeChat to finish the automatic playing of the audio file.
In order to achieve the purpose, the invention adopts another technical scheme as follows:
device for automatic audio playback of a WeChat-based H5 page, comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the processor, when executing the program, carries out the following steps:
s1, introducing the WeChat JS-SDK file into HTML 5;
s2, acquiring an audio file to be played, and executing a first configuration file in the WeChat;
and S3, monitoring through a second configuration file in the WeChat to finish the automatic playing of the audio file.
(III) advantageous effects
The invention has the beneficial effects that: by introducing the WeChat JS-SDK file into HTML 5; acquiring an audio file to be played, and executing a first configuration file in the WeChat; and monitoring through a second configuration file in the WeChat to finish the automatic playing of the audio file, so that the automatic playing of the audio file is realized in the iOS terminal, and the user experience is improved.
Drawings
FIG. 1 is a flowchart of a method for automatically playing an audio based on WeChat H5 page according to an embodiment of the present invention;
fig. 2 is a schematic structural diagram of an apparatus for automatically playing an audio based on a wechat H5 page according to an embodiment of the present invention.
[ description of reference ]
1: a device for automatic audio playback based on the WeChat H5 page;
2: a memory;
3: a processor.
Detailed Description
For the purpose of better explaining the present invention and to facilitate understanding, the present invention will be described in detail by way of specific embodiments with reference to the accompanying drawings.
Referring to fig. 1, the method for automatically playing the audio of the H5 page based on WeChat includes the following steps:
s1, introducing the WeChat JS-SDK file into HTML 5;
s2, acquiring an audio file to be played, and executing a first configuration file in the WeChat;
the first configuration file is a wx.
Specifically, after the audio file to be played is obtained, wx.config ({.. }) is executed, and the configuration information may be error information;
and S3, monitoring through a second configuration file in the WeChat to finish the automatic playing of the audio file.
The second configuration file is a wx.
Specifically, wx.config and wx.ready are two function calls, the first call is initialization, and the second call is to execute a snoop action after the initialization is completed.
Step S3 specifically includes:
and monitoring through a second configuration file in the WeChat, and triggering the loading and playing of the audio file in a callback function to finish the automatic playing of the audio file.
Specifically, listening is performed through wx.ready (function () {.. }), and audio loading and playing are triggered in a callback function.
In addition, when a new audio file is loaded, only the steps S2 and S3 need to be repeated, the playing efficiency of the audio file is high, and the user experience is improved.
Example two
Referring to fig. 2, the apparatus 1 for automatically playing back an audio based on the H5 page of WeChat includes a memory 2, a processor 3, and a computer program stored in the memory 2 and running on the processor 3, wherein the processor 3 implements the steps of the first embodiment when executing the program.
The above description is only an embodiment of the present invention, and not intended to limit the scope of the present invention, and all equivalent changes made by using the contents of the present specification and the drawings, or applied directly or indirectly to the related technical fields, are included in the scope of the present invention.
Claims (8)
1. The method for automatically playing the audio of the H5 page based on the WeChat is characterized by comprising the following steps:
s1, introducing the WeChat JS-SDK file into HTML 5;
s2, acquiring an audio file to be played, and executing a first configuration file in the WeChat;
and S3, monitoring through a second configuration file in the WeChat to finish the automatic playing of the audio file.
2. The method for automatic audio playback of a wechat-based H5 page according to claim 1, wherein the first profile is a wx.
3. The method for automatic audio playback of a wechat-based H5 page of claim 1, wherein the second profile is a wx.
4. The method for automatically playing the audio of the WeChat-based H5 page according to claim 1, wherein the step S3 is specifically as follows:
and monitoring through a second configuration file in the WeChat, and triggering the loading and playing of the audio file in a callback function to finish the automatic playing of the audio file.
5. Device for automatic audio playback of a WeChat-based H5 page, comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the processor, when executing the program, carries out the following steps:
s1, introducing the WeChat JS-SDK file into HTML 5;
s2, acquiring an audio file to be played, and executing a first configuration file in the WeChat;
and S3, monitoring through a second configuration file in the WeChat to finish the automatic playing of the audio file.
6. The apparatus for automated audio playback of a WeChat-based H5 page according to claim 5, wherein the first profile is a wx.
7. The apparatus for automated audio playback of a WeChat-based H5 page as recited in claim 5, wherein the second profile is a wx.
8. The apparatus for automatically playing the audio of the WeChat-based H5 page according to claim 5, wherein the step S3 is specifically:
and monitoring through a second configuration file in the WeChat, and triggering the loading and playing of the audio file in a callback function to finish the automatic playing of the audio file.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011560026.3A CN112579039A (en) | 2020-12-25 | 2020-12-25 | Method and equipment for automatically playing audio of H5 page based on WeChat |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011560026.3A CN112579039A (en) | 2020-12-25 | 2020-12-25 | Method and equipment for automatically playing audio of H5 page based on WeChat |
Publications (1)
Publication Number | Publication Date |
---|---|
CN112579039A true CN112579039A (en) | 2021-03-30 |
Family
ID=75140504
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202011560026.3A Pending CN112579039A (en) | 2020-12-25 | 2020-12-25 | Method and equipment for automatically playing audio of H5 page based on WeChat |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112579039A (en) |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106649297A (en) * | 2015-07-21 | 2017-05-10 | 腾讯科技(深圳)有限公司 | Method, browser and server for playing webpage audio file |
CN110225404A (en) * | 2019-06-17 | 2019-09-10 | 深圳市正易龙科技有限公司 | Video broadcasting method, terminal and computer readable storage medium |
-
2020
- 2020-12-25 CN CN202011560026.3A patent/CN112579039A/en active Pending
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106649297A (en) * | 2015-07-21 | 2017-05-10 | 腾讯科技(深圳)有限公司 | Method, browser and server for playing webpage audio file |
CN110225404A (en) * | 2019-06-17 | 2019-09-10 | 深圳市正易龙科技有限公司 | Video broadcasting method, terminal and computer readable storage medium |
Non-Patent Citations (1)
Title |
---|
ZZZ-_-CH: "解决 iPhone微信H5无法自动播放音乐问题", 《HTTPS://BLOG.CSDN.NET/WEIXIN_43698257/ARTICLE/DETAILS/84302808》 * |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN106406940A (en) | System upgrading method, system upgrading apparatus, and terminal | |
US11711686B2 (en) | Method for controlling display of SIM card function menu and storage device for the same | |
US20220078595A1 (en) | Method and apparatus for back-connecting bluetooth device, terminal and computer-readable storage medium | |
US9451423B2 (en) | Method and apparatus for recording information during a call | |
CN105843599A (en) | Method and apparatus for reducing user high-frequency operation influence, and user terminal | |
CN105022687A (en) | Implementation method and device of sliding operation in automated testing scheme | |
CN105653195A (en) | Screen capturing method and mobile terminal | |
CN112579039A (en) | Method and equipment for automatically playing audio of H5 page based on WeChat | |
CN112162783B (en) | Music playing application keep-alive processing method and system, storage medium and electronic equipment | |
WO2016165234A1 (en) | Terminal language setting method and apparatus, and terminal | |
CN106131277A (en) | A kind of telephone number storage method and mobile terminal | |
CN104182331B (en) | Browser performance test method, system and terminal | |
CN110277110B (en) | Recording and playing method and device of network page and terminal | |
CN104391742B (en) | Optimizing application method and apparatus | |
CN110806856A (en) | Data loading method and device and electronic equipment | |
CN112527535B (en) | Interaction method and terminal based on native WebView extension application | |
CN105740009B (en) | Version upgrading method and terminal device | |
CN115482821A (en) | Voice control method and device, electronic equipment and storage medium | |
CN111050240A (en) | Earphone mode switching method and device | |
TW201721405A (en) | An electronic device and method for replaying voice | |
CN106161768A (en) | A kind of verbal system choosing method and device | |
CN101848259A (en) | Speech processing method and system for digital family fixed telephone | |
CN107483750B (en) | Ringtone setting method and device | |
CN111026651B (en) | Test method, device, storage medium and electronic equipment | |
CN113126987A (en) | Method for improving interaction between H5 application and equipment and storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20210330 |