A probe into video embedding in mobile phone terminal

Source: Internet
Author: User

Recently has been doing mobile, and now dealing with js,jq far more than Html,css, which makes the programming base is very thin I feel pressure, I hope to step smoothly to overcome the difficulties.

To insert a video into your phone today, you need to introduce Youku or Tudou video links. The first thing that comes to mind is the HTML5 video tag, but the URL that is copied directly from the Web site is in SWF format, and this format video is not supported at all. So change back <object><embed> tag to write, put on the phone page ~ results iOS does not support flash playback.

But what about the videos that were shared? So I found a link to start the analysis,

This is the video information you see locally, and you can see that the file format is SWF

This is the display of Google analog mobile browser, suffix into the MP4.

That is, these video sites through user-agent to determine the user source, if it is an iOS user, the video tag instead of the traditional object, its SRC is the source address (not FLV, but the source of TS Wrapper, m3u8 is a text file, which specifies a further TS address, Including some video segmentation parameters, etc.); For other users, the SWF player is still used for compatibility and functionality reasons.

Where do I find the source address?

We take Youku, for example, to open a video, as follows

Click the drop-down arrow on the right side of the friend to share the miracle.

The bottom of the common code, instantly feel that you wasted a lot of time.

<iframe height=498 width=510 src= "http://player.youku.com/embed/XOTU5NjU1NDY4" frameborder=0 allowfullscreen> </iframe>

Also, it is said that no ads can be inserted into the video, but it seems to be for the PC side, the method is as follows:

The first type:

<src= "http://static.youku.com/v/swf/qplayer.swf?winType=adshow&VideoIDS= Xndgyotyzmzu2&isautoplay=true&isshowrelatedvideo=false "  wmode=" Transparent "  Width= "480"  align= "center"  border= "0"  height = "The " ></ Embed >

"Note One: This does not have a toolbar without a border may be set size is needed to adjust width/height"

"Note Two: Put the above code The xndq4odmzmzq4 in Videoids=xndq4odmzmzq4 will be replaced by your own video ID. "

"Note three:Isautoplay set AutoPlay"

The second type:

<Embedtype= "Application/x-shockwave-flash"src= "http://static.youku.com/v1.0.0201/v/swf/qplayer_taobao.swf?" Videoids=xndq4odmzmzq4=&isautoplay=false&isshowrelatedvideo=false&embedid=-&showad=0 "ID= "Movie_player"name= "Movie_player"bgcolor= "#FFFFFF"Quality= "High"Wmode= "Transparent"allowFullScreen= "true"Flashvars= "isshowrelatedvideo=false&showad=0&show_pre=1&show_next=1&isautoplay=false&isdebug= FALSE&USERID=&WINTYPE=INTERIOR&PLAYMOVIE=TRUE&MM control=false&mmout=false&recordcode= 1001,1002,1003,1004,1005,1006,2001,3001,3002,3003,3004,3005,3007,3008,9999 "pluginspage= "Http://www.macromedia.com/go/getflashplayer"width= "The "Height= "327"></Embed> 

By the way, share some of the information gathered today:

<OBJECTClassID= "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"codebase= "http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"WIDTH= "550"HEIGHT= "The "ID= "Mymoviename"> <PARAMNAME=movieVALUE= "myflashmovie.swf"> <PARAMNAME=qualityVALUE=high> <PARAMNAME=bgcolorVALUE= #FFFFFF> <EMBEDsrc= "/support/flash/ts/documents/myflashmovie.swf"Quality=highbgcolor= #FFFFFFWIDTH= "550"HEIGHT= "The "NAME= "Mymoviename"ALIGN=""TYPE= "Application/x-shockwave-flash"pluginspage= "Http://www.macromedia.com/go/getflashplayer"> </EMBED> </OBJECT>

The OBJECT tag is used for Windows IE3.0 and later browsers or other browsers that support ActiveX controls. The "ClassID" and "codebase" properties must be written exactly as shown in the example above, which tells the browser to automatically download the address of the Flash Player. If you have not installed Flash Player then the IE3.0 browser will jump out of a box to access whether or not you want to install Flash Player automatically. Of course, if you don't want users who don't have Flash Player installed to download the player automatically, maybe you can omit the code.
The embed tag is used for Netscape Navigator2.0 and later browsers or other browsers that support Netscape plugins. The "pluginspage" property tells the browser to download the address of Flash Player, and if you do not have Flash Player installed, you will need to restart your browser to use it.
to make sure that most browsers display flash correctly, you need to nest the embed tag inside the OBJECT tag as shown in the code example above. Browsers that support ActiveX controls will ignore the embed tag within the OBJECT tag. Netscape and the IE browser using the plugin will read only the embed tag without recognizing the OBJECT tag. In other words, if you omit the embed tag, then Firefox will not recognize your flash (but it is puzzling that the omitted object only write Embed,ie can also display the flash, hehe, specific and then carefully see).

The following lists the necessary and optional properties for the object and embed tags used to publish the movie.

First, required attributes:
· classid-sets the browser's ActiveX control for the OBJECT tag only.
· codebase-sets the location of the Flash ActiveX control, so if the browser is not installed, you can download the installation automatically. Only for object tags.
· width-Specifies the width of the flash movie in percent or pixels.
· height-Specifies the height of the flash movie in percent or pixels.
· src-for the specified movie. For embed labels only.
· pluginspage-set the location of the Flash plugin, so if the browser is not installed, you can download the installation automatically. For embed labels only.
· movie-for the specified movie. Only for object tags.

second, optional attributes and available values:
· id-sets the variable name for reference to the script code. For object only.
datastore-Sets the variable name for a reference to the script code (such as JavaScript). For embed only.
· Swliveconnect-(TRUE or FALSE) Specifies whether Java is enabled when Flash Player downloads for the first time. If some attributes are omitted, the default value is False. You must use Fscommand to work with JavaScript and Flash,java on the same page.
· Play-(TRUE or FALSE) specifies whether the Flash movie will play automatically after the download is complete, or true if this attribute is omitted.
· Loop-(TRUE or FALSE) specifies whether to stop or resume looping after the last frame of the movie is played, or true if this attribute is omitted.
· MENU-(True or false)
· True displays all menus, allowing users to zoom in, zoom out, and so on to control movie playback and other actions.
· False displays only the settings options and the menu about flash.
· Quality-(low, High, Autolow, Autohigh, best)
· The low speed is superior to aesthetics and does not apply anti-aliasing.
· Autolow is just beginning to focus on speed, but when needed, it improves aesthetics at any time.
· Autohigh at the same time focus on the playback speed and aesthetics, but the need to sacrifice beauty to ensure the playback speed.
· Medium applies some anti-aliasing instead of smoothing bitmaps. It is higher quality than the low setting and below the high setting.
· High aesthetics is better than playback speed, and anti-aliasing has been applied. If the movie does not contain animations, the bitmap is smoothed, and if the movie contains animations, the bitmap will not be smoothed.
· Best provides the highest display quality without regard to playback speed. All outputs have anti-aliasing applied and all bitmaps are smoothed.
· Scale-(ShowAll, Noborder, Exactfit)
· The Default show all movie is displayed within the specified area, but the original scale is maintained. A border will appear on both sides of the movie.
· No boder shrinks the movie to fit the specified area, keeping the movie not distorted, but some of the videos will probably be cropped. Keep the original proportions of the film however.
· Exact Fit causes the entire movie to be displayed in the specified area, and the movie is likely to distort and not maintain the original proportions.
· ALIGN-(L, T, R, b)
• The default is centered, and the edges are cropped when the browser window is smaller than the movie.
· The Left,right,top,bottom is aligned along the edge of the browser according to the corresponding settings. If necessary, the other three sides will be cropped.
· Salign-(L, T, R, B, TL, TR, bl, BR)
· L,r,t,b
· Tl,tr
· BL,BR
· wmode-(window, opaque, transparent) sets the window Mode property of the Flash movie, specifying the transparency, stacking, and placement of flash in the browser.
· The window movie plays within its own rectangular window in the browser.
· The Opaque movie hides all the content behind it.
· Transparent makes flash movies transparent, showing the contents of pages behind transparent movies. This will degrade the performance of the animation. And this property is not available in all browsers.
· BGCOLOR-(#RRGGBB, hexadecimal RGB value. Specifies the background color of the movie. Use this property to override the background color set in Flash.
· Base-Sets the base directory or URL that is used to resolve the relative path in Flash. Similar to <base> tags in web pages.
· Flashvars passing variables to Flash Player requires Flash PLAYER6 and later versions.
• Pass the root level variable to the movie. The format of the string is the Name=value set separated by "&".
• The browser supports 64kB size string lengths.
• For more information about Flashvars, please see the documentation.

A probe into video embedding in mobile phone terminal

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.