FMUSER Wirless Transmit Video And Audio More Easier !
es.fmuser.org
it.fmuser.org
fr.fmuser.org
de.fmuser.org
af.fmuser.org ->Afrikaans
sq.fmuser.org ->Albanian
ar.fmuser.org ->Arabic
hy.fmuser.org ->Armenian
az.fmuser.org ->Azerbaijani
eu.fmuser.org ->Basque
be.fmuser.org ->Belarusian
bg.fmuser.org ->Bulgarian
ca.fmuser.org ->Catalan
zh-CN.fmuser.org ->Chinese (Simplified)
zh-TW.fmuser.org ->Chinese (Traditional)
hr.fmuser.org ->Croatian
cs.fmuser.org ->Czech
da.fmuser.org ->Danish
nl.fmuser.org ->Dutch
et.fmuser.org ->Estonian
tl.fmuser.org ->Filipino
fi.fmuser.org ->Finnish
fr.fmuser.org ->French
gl.fmuser.org ->Galician
ka.fmuser.org ->Georgian
de.fmuser.org ->German
el.fmuser.org ->Greek
ht.fmuser.org ->Haitian Creole
iw.fmuser.org ->Hebrew
hi.fmuser.org ->Hindi
hu.fmuser.org ->Hungarian
is.fmuser.org ->Icelandic
id.fmuser.org ->Indonesian
ga.fmuser.org ->Irish
it.fmuser.org ->Italian
ja.fmuser.org ->Japanese
ko.fmuser.org ->Korean
lv.fmuser.org ->Latvian
lt.fmuser.org ->Lithuanian
mk.fmuser.org ->Macedonian
ms.fmuser.org ->Malay
mt.fmuser.org ->Maltese
no.fmuser.org ->Norwegian
fa.fmuser.org ->Persian
pl.fmuser.org ->Polish
pt.fmuser.org ->Portuguese
ro.fmuser.org ->Romanian
ru.fmuser.org ->Russian
sr.fmuser.org ->Serbian
sk.fmuser.org ->Slovak
sl.fmuser.org ->Slovenian
es.fmuser.org ->Spanish
sw.fmuser.org ->Swahili
sv.fmuser.org ->Swedish
th.fmuser.org ->Thai
tr.fmuser.org ->Turkish
uk.fmuser.org ->Ukrainian
ur.fmuser.org ->Urdu
vi.fmuser.org ->Vietnamese
cy.fmuser.org ->Welsh
yi.fmuser.org ->Yiddish
1. The design idea of h5 player
These functions should be included after reconstruction: support for on-demand (non-encrypted MP4) and live broadcast (m3u8), compatible (adapted) to mobile terminals, and automatically select (use flash or h5) according to the platform.
In terms of frameworks and libraries, we still choose to mainly use nej framework, nej provides a wealth of methods. The classes that are exposed to the outside world are implemented using regular, because most of the front-end components and business projects of education products use regular, which is very convenient to use. In addition, the flexible solution is selected on the mobile terminal, because the web page adaptation of education products has been unified using flexible, and the handling of gesture events is selected.
In order to facilitate the expansion and addition of components, the observer mode is used. The observer mode is very suitable for use in a project of the size of a video player, and it is also a design mode that has been tried and tested. I directly referred to the similar implementation in flex, and wrote it again using js (of course, I wrote it very quickly).
As shown in the figure above, the component base class and the componentContainer singleton class implement the observer pattern. All components are inherited from the component class. In the component instance, methods can be called to send notification objects for communication between components. The notification scheduling is in the componentContainer. Achieved. These components are divided into required components and optional components. The necessary components include: video object component (movieData), video playback component (mainVideo), api component, etc. The optional components are developed according to the business requirements of different products, which can be developed through The configuration of different component lists customizes the specific functions of the player, which is also implemented in componentContainer. Html5VideoMedia is an encapsulation of HTMLVideoElement. It is not used as a component, but only provides video playback functions and defines related events. In addition to video playback components, Html5VideoMedia can also be an introductory advertising component.
In terms of adaptation, the flexible scheme is used for style adaptation. Some components are more complex, such as the control bar. The web and mobile functions are very different, and the styles are also very different. You can consider using different components on different platforms (control and controlMobile can be seen in the figure), and the logic will be very clear. , Do not need to write a lot of if and else, but because it depends on more components, the js and css files will be larger. I personally feel that in order to improve the maintainability of the code, it is advisable to sacrifice part of the file size.
,
2. Some features of hls live broadcast
Judgment of live broadcast status. In fact, the live broadcast function is closely related to the business. The live broadcast status here is also the status of the business only, such as: not started, about to start, live broadcast, live broadcast ended, etc. Our products still use front-end polling to update the status of the live broadcast. One thing to mention is that the hls stream will not trigger the end event, so the status of the h5 live broadcast is actually controlled entirely by polling.
How to determine the flow is abnormal. For general network problems or source problems, you can monitor the error events of the video tag and the source tag. Both tags need to be monitored. But the error message when the error is triggered is sometimes not information, or different browsers have different implementations. I have encountered changing the currentTime attribute to seek before, and occasionally the error event will be triggered, but the error only says that it is a network error. Without any other information, it was really painful to determine that it was a video transcoding problem after comparing other videos. During the playback of a live stream, occasional streaming exceptions may occur. Streaming exceptions generally appear as screen freezes and may not necessarily trigger error events. I refer to the previous Qingguo colleague's plan: check currentTime every once in a while, if currentTime does not change during this period of time in the playback state, it is likely that the stream is abnormal, and then actively reload.
,
3. Some problems that cannot be solved at present
There are many video-related problems on ios, because the system has too many restrictions. List a little bit:
1. Only one video or audio can be played at the same time, and only one video or audio tag is allowed. It will be a little troublesome to do the introductory advertisement function.
2. Play videos in Safari with lower ios version will force full screen, and ios 10 can use playsinline. You can add webkit-playsinline to WeChat and some customized webkits.
3. Without human operation, it is impossible to enter the page to automatically start playing the video
4. In ios, js cannot be used to control the video volume, it can only be controlled by physical buttons. In ios, you can directly hide the volume control function. . .
5. There is also the issue of taking screenshots, but there is no research if it is not used in the product.
There are also many problems on Android, mainly because there are too many Android versions, too many models, and all aspects are uneven. List a little bit:
1. Some android systems will directly replace the video tag and use the system player to play, which is common in domestic mobile phones
2. The detection result of the canPlayType method does not match the actual situation. This problem has been encountered during the development process. For example, it was detected that m3u8 playback is not supported on an Asus mobile phone, but it can actually be played. I originally wanted to let go of this restriction, but later found Forced playback in the webview of the Cloud Classroom app may cause the app to crash, so the detection is added at the end. .
3. Androids that do not support m3u8 playback are generally around android4.0 and below
|
Enter email to get a surprise
es.fmuser.org
it.fmuser.org
fr.fmuser.org
de.fmuser.org
af.fmuser.org ->Afrikaans
sq.fmuser.org ->Albanian
ar.fmuser.org ->Arabic
hy.fmuser.org ->Armenian
az.fmuser.org ->Azerbaijani
eu.fmuser.org ->Basque
be.fmuser.org ->Belarusian
bg.fmuser.org ->Bulgarian
ca.fmuser.org ->Catalan
zh-CN.fmuser.org ->Chinese (Simplified)
zh-TW.fmuser.org ->Chinese (Traditional)
hr.fmuser.org ->Croatian
cs.fmuser.org ->Czech
da.fmuser.org ->Danish
nl.fmuser.org ->Dutch
et.fmuser.org ->Estonian
tl.fmuser.org ->Filipino
fi.fmuser.org ->Finnish
fr.fmuser.org ->French
gl.fmuser.org ->Galician
ka.fmuser.org ->Georgian
de.fmuser.org ->German
el.fmuser.org ->Greek
ht.fmuser.org ->Haitian Creole
iw.fmuser.org ->Hebrew
hi.fmuser.org ->Hindi
hu.fmuser.org ->Hungarian
is.fmuser.org ->Icelandic
id.fmuser.org ->Indonesian
ga.fmuser.org ->Irish
it.fmuser.org ->Italian
ja.fmuser.org ->Japanese
ko.fmuser.org ->Korean
lv.fmuser.org ->Latvian
lt.fmuser.org ->Lithuanian
mk.fmuser.org ->Macedonian
ms.fmuser.org ->Malay
mt.fmuser.org ->Maltese
no.fmuser.org ->Norwegian
fa.fmuser.org ->Persian
pl.fmuser.org ->Polish
pt.fmuser.org ->Portuguese
ro.fmuser.org ->Romanian
ru.fmuser.org ->Russian
sr.fmuser.org ->Serbian
sk.fmuser.org ->Slovak
sl.fmuser.org ->Slovenian
es.fmuser.org ->Spanish
sw.fmuser.org ->Swahili
sv.fmuser.org ->Swedish
th.fmuser.org ->Thai
tr.fmuser.org ->Turkish
uk.fmuser.org ->Ukrainian
ur.fmuser.org ->Urdu
vi.fmuser.org ->Vietnamese
cy.fmuser.org ->Welsh
yi.fmuser.org ->Yiddish
FMUSER Wirless Transmit Video And Audio More Easier !
Contact
Address:
No.305 Room HuiLan Building No.273 Huanpu Road Guangzhou China 510620
Categories
Newsletter