Write a simple demo in smil language

Source: Internet
Author: User

First, the points to note are:

1. When writing code in Notepad, save the file with the suffix named. smil or. SMI, and the encoding format is selected as UTF-8.

2. The player to open the. smil file is selected as: RealPlayer or Ambulantplayer, respectively.

Realplayer:https://www.realnetworks.com/products-services/realmedia-hd-suite/realplayer-hd

Ambulantplayer:http://www.ambulantplayer.org/Download200.shtml

3.smil learning URLs can be:http://www.w3school.com.cn/smil/index.asp  and http:// 79343654.iteye.com/blog/1328448 and so on.

4. The written code may produce some extra code during the player's playback, which is usually in front of </smil> and should be checked.

5. In the process of testing the effect, do not close the RealPlayer frequently, close several times it will not open, can only restart the computer to reopen (perhaps my computer problem).

II, code

basic knowledge in the above learning URL, smil and HTML are very similar, very good learning, so I directly on the code. ( All multimedia materials to be used are stored in a materials file)

<smil>

<layout>

<root-layout width= "height=" "720" background-color= "white"/>

<region id= "Video_one" left= "4" top= "4" width= "960" height= "540" fit= "Meet" z-index= "5"/>

<region id= "Image_one" left= "968" top= "4" width= "308" height= "177" fit= "Meet"/>

<region id= "Image_two" left= "968" top= "185" width= "308" height= "177" fit= "Meet"/>

<region id= "Image_three" left= "968" top= "365" width= "308" height= "177" fit= "Meet"/>

<region id= "Text_one" left= "4" top= "547" width= "1272" height= "720" fit= "Meet"/>

<region id= "Image_four" left= "0" width= "All" height= "" "fit=" Meet "/>

</layout>

<body>

<par>

<video src= "MATERIALS/SAKAMOTO.RMVB" region= "Video_one" begin= "0" dur= "+" fill= "Freeze"/>

<audio src= "Materials/music1.mp3" begin= "end="

<audio src= "Materials/music2.mp3" begin= "end="

<audio src= "Materials/music3.mp3" begin= "end="

<text src= "Materials/text1.txt" region= "Text_one" begin= "0" end= "/>"

<text src= "Materials/text2.txt" region= "Text_one" begin= "$" end= "" "/>

<text src= "Materials/text3.txt" region= "Text_one" begin= "" "" End= "/>"

<text src= "Materials/text4.txt" region= "Text_one" begin= "a" end= "a"/>

</par>

</body>

</smil>

The above code implements the following functions: 1. Play the video and display the explanatory text.

2. Play the music and simultaneously display the text and pictures corresponding to the music. (The largest image in the picture is a frame after the end of the video)

<smil xmlns= "Http://www.w3.org/2001/SMIL20/Language" >

<layout>

<root-layout width= "height=" "720" background-color= "white"/>

<region id= "Image_four" left= "0" top= "272" width= "308" height= "177" fit= "Meet"/>

</layout>

<transition id= "Fade1" type= "Fade" subtype= "Fadetocolor" dur= "4s"/> <transition id= "Fade2" type= "Fade" Subtype= "Fadefromcolor" dur= "4s"/>

<transition id= "Wipe1" type= "Slidewipe" subtype= "fromtop" dur= "4s"/> <transition id= "wipe2" type= " Waterfallwipe "dur=" 4s "/>

<body>

<seq>

<animatemotion from= "0 272" to= "972 272" dur= ""/> "

</img>

<animate attributename= "height" from= "to=" 720 "fill=" Freeze "dur=10s"/>

</img>

</seq>

</body>

</smil>

This code should normally show the image move, zoom in, fade in and erase the effect, but because my RealPlayer open several files can not continue to open the file, I can only turn off RealPlayer, and this led me to constantly switch machine, However, the speed of my computer was extremely slow, and I spent a lot of time on it and never opened the. smil file. Plus the next week I have to complete the streaming server build, get a multimedia player, do a voice/video codec (of course, in such a short time to complete these must be to learn from other people's code), in short, smil learning first temporarily ended.

      

Write a simple demo in smil language

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.