Browse Source

change the comments of live-channel to English

hangzws 7 years ago
parent
commit
d802dd1af5
4 changed files with 142 additions and 140 deletions
  1. 42 41
      oss/livechannel.go
  2. 9 9
      oss/livechannel_test.go
  3. 54 55
      oss/type.go
  4. 37 35
      sample/livechannel.go

+ 42 - 41
oss/livechannel.go

@@ -10,13 +10,13 @@ import (
 )
 
 //
-// CreateLiveChannel 创建推流直播频道
+// CreateLiveChannel    create a live-channel
 //
-// channelName 直播流频道名称
-// config 直播流频的配置信息
+// channelName  the name of the channel
+// config       configuration of the channel
 //
-// CreateLiveChannelResult 创建直播流频请求的返回结果
-// error 操作无错误时返回nil,非nil为错误信息
+// CreateLiveChannelResult  the result of create live-channel
+// error        nil if success, otherwise error
 //
 func (bucket Bucket) CreateLiveChannel(channelName string, config LiveChannelConfiguration) (CreateLiveChannelResult, error) {
 	var out CreateLiveChannelResult
@@ -42,12 +42,12 @@ func (bucket Bucket) CreateLiveChannel(channelName string, config LiveChannelCon
 }
 
 //
-// PutLiveChannelStatus 设置直播频道的状态,有两种状态可选:enabled和disabled
+// PutLiveChannelStatus Set the status of the live-channel: enabled/disabled
 //
-// channelName 直播流频道的名称
-// status 状态,有两种状态可选:enabled和disabled
+// channelName  the name of the channel
+// status       enabled/disabled
 //
-// error 操作无错误时返回nil, 非nil为错误信息
+// error        nil if success, otherwise error
 //
 func (bucket Bucket) PutLiveChannelStatus(channelName, status string) error {
 	params := map[string]interface{}{}
@@ -63,14 +63,14 @@ func (bucket Bucket) PutLiveChannelStatus(channelName, status string) error {
 	return checkRespCode(resp.StatusCode, []int{http.StatusOK})
 }
 
-// PostVodPlaylist 根据指定的playlist name以及startTime和endTime生成一个点播的播放列表
+// PostVodPlaylist  create an playlist based on the specified playlist name, startTime and endTime
 //
-// channelName 直播流频道的名称
-// playlistName 指定生成的点播列表的名称,必须以”.m3u8“结尾
-// startTime 指定查询ts文件的起始时间
-// endTime 指定查询ts文件的终止时间
+// channelName  the name of the channel
+// playlistName the name of the playlist, must end with ".m3u8"
+// startTime    the start time of the playlist
+// endTime      the endtime of the playlist
 //
-// error 操作无错误是返回nil, 非nil为错误信息
+// error        nil if success, otherwise error
 //
 func (bucket Bucket) PostVodPlaylist(channelName, playlistName string, startTime, endTime time.Time) error {
 	params := map[string]interface{}{}
@@ -89,12 +89,12 @@ func (bucket Bucket) PostVodPlaylist(channelName, playlistName string, startTime
 }
 
 //
-// GetLiveChannelStat 获取指定直播流频道当前推流的状态
+// GetLiveChannelStat   Get the state of the live-channel
 //
-// channelName 直播流频道的名称
+// channelName  the name of the channel
 //
-// LiveChannelStat 直播流频道当前推流状态信息
-// error 操作无错误是返回nil, 非nil为错误信息
+// LiveChannelStat  the state of the live-channel
+// error        nil if success, otherwise error
 //
 func (bucket Bucket) GetLiveChannelStat(channelName string) (LiveChannelStat, error) {
 	var out LiveChannelStat
@@ -113,12 +113,12 @@ func (bucket Bucket) GetLiveChannelStat(channelName string) (LiveChannelStat, er
 }
 
 //
-// GetLiveChannelInfo 获取直播流频道的配置信息
+// GetLiveChannelInfo   Get the configuration info of the live-channel
 //
-// channelName 直播流频道的名称
+// channelName  the name of the channel
 //
-// LiveChannelConfiguration 直播流频道的配置信息
-// error 操作无错误返回nil, 非nil为错误信息
+// LiveChannelConfiguration the configuration info of the live-channel
+// error        nil if success, otherwise error
 //
 func (bucket Bucket) GetLiveChannelInfo(channelName string) (LiveChannelConfiguration, error) {
 	var out LiveChannelConfiguration
@@ -136,12 +136,12 @@ func (bucket Bucket) GetLiveChannelInfo(channelName string) (LiveChannelConfigur
 }
 
 //
-// GetLiveChannelHistory 获取直播流频道的历史推流记录
+// GetLiveChannelHistory    Get push records of live-channel
 //
-// channelName 直播流频道名称
+// channelName  the name of the channel
 //
-// LiveChannelHistory 返回的直播流历史推流记录
-// error 操作无错误返回nil, 非nil为错误信息
+// LiveChannelHistory   push records
+// error        nil if success, otherwise error
 //
 func (bucket Bucket) GetLiveChannelHistory(channelName string) (LiveChannelHistory, error) {
 	var out LiveChannelHistory
@@ -160,17 +160,18 @@ func (bucket Bucket) GetLiveChannelHistory(channelName string) (LiveChannelHisto
 }
 
 //
-// ListLiveChannel 获取直播流频道的信息列表
+// ListLiveChannel  list the live-channels
 //
-// options  筛选选项:Prefix指定的前缀、MaxKeys为返回的最大数目、Marker代表从哪个livechannel作为游标开始列表
+// options  Prefix: filter by the name start with the value of "Prefix"
+//          MaxKeys: the maximum count returned
+//          Marker: cursor from which starting list
 //
-// ListLiveChannelResult 返回的livechannel列表结果
-// error 操作无结果返回nil, 非nil为错误信息
+// ListLiveChannelResult    live-channel list
+// error    nil if success, otherwise error
 //
 func (bucket Bucket) ListLiveChannel(options ...Option) (ListLiveChannelResult, error) {
 	var out ListLiveChannelResult
 
-	//options = append(options, EncodingType("url"))
 	params, err := getRawParams(options)
 	if err != nil {
 		return out, err
@@ -189,11 +190,11 @@ func (bucket Bucket) ListLiveChannel(options ...Option) (ListLiveChannelResult,
 }
 
 //
-// DeleteLiveChannel 删除指定的livechannel,当有客户端正在想livechannel推流时,删除请求回失败,本接口志辉删除livechannel本身,不会删除推流生成的文件
+// DeleteLiveChannel    Delete the live-channel. When a client trying to stream the live-channel, the operation will fail. it will only delete the live-channel itself and the object generated by the live-channel will not be deleted.
 //
-// channelName 直播流的频道名称
+// channelName  the name of the channel
 //
-// error 操作无错误返回nil, 非nil为错误信息
+// error        nil if success, otherwise error
 //
 func (bucket Bucket) DeleteLiveChannel(channelName string) error {
 	params := map[string]interface{}{}
@@ -213,14 +214,14 @@ func (bucket Bucket) DeleteLiveChannel(channelName string) error {
 }
 
 //
-// SignRtmpURL 生成RTMP推流签名的URL, 常见的用法是生成加签的URL以供授信用户向OSS推RTMP流。
+// SignRtmpURL  Generate a RTMP push-stream signature URL for the trusted user to push the RTMP stream to the live-channel.
 //
-// channelName 直播流的频道名称
-// playlistName 播放列表名称,其值会覆盖LiveChannel中的配置,必须以“.m3u8”结尾
-// expires 过期时间(单位:秒),链接在当前时间再过expires秒后过期
+// channelName  the name of the channel
+// playlistName the name of the playlist, must end with ".m3u8"
+// expires      expiration (in seconds)
 //
-// string 返回的加签的rtmp推流地址
-// error 操作无错误返回nil, 非nil为错误信息
+// string       singed rtmp push stream url
+// error        nil if success, otherwise error
 //
 func (bucket Bucket) SignRtmpURL(channelName, playlistName string, expires int64) (string, error) {
 	if expires < 0 {

+ 9 - 9
oss/livechannel_test.go

@@ -15,7 +15,7 @@ type OssBucketLiveChannelSuite struct {
 
 var _ = Suite(&OssBucketLiveChannelSuite{})
 
-// Run once when the suite starts running
+// SetUpSuite Run once when the suite starts running
 func (s *OssBucketLiveChannelSuite) SetUpSuite(c *C) {
 	client, err := New(endpoint, accessID, accessKey)
 	c.Assert(err, IsNil)
@@ -32,7 +32,7 @@ func (s *OssBucketLiveChannelSuite) SetUpSuite(c *C) {
 	testLogger.Println("test livechannel started...")
 }
 
-// Run once after all tests or benckmarks have finished running
+// TearDownSuite Run once after all tests or benchmarks
 func (s *OssBucketLiveChannelSuite) TearDownSuite(c *C) {
 	marker := ""
 	for {
@@ -54,12 +54,12 @@ func (s *OssBucketLiveChannelSuite) TearDownSuite(c *C) {
 	testLogger.Println("test livechannel done...")
 }
 
-// Run after each test or benchmark runs
+// SetUpTest Run before each test or benchmark starts
 func (s *OssBucketLiveChannelSuite) SetUpTest(c *C) {
 
 }
 
-// Run once after all tests or benchmarks have finished running
+// TearDownTest	Run after each test or benchmark runs.
 func (s *OssBucketLiveChannelSuite) TearDownTest(c *C) {
 
 }
@@ -158,7 +158,7 @@ func (s *OssBucketLiveChannelSuite) TestGetLiveChannelInfo(c *C) {
 
 	getCfg, err := s.bucket.GetLiveChannelInfo(channelName)
 	c.Assert(err, IsNil)
-	c.Assert("enabled", Equals, getCfg.Status) //默认值为enabled
+	c.Assert("enabled", Equals, getCfg.Status) //The default value is enabled
 	c.Assert("HLS", Equals, getCfg.Target.Type)
 	c.Assert(10, Equals, getCfg.Target.FragDuration)
 	c.Assert(4, Equals, getCfg.Target.FragCount)
@@ -205,7 +205,7 @@ func (s *OssBucketLiveChannelSuite) TestPutLiveChannelStatus(c *C) {
 	c.Assert(err, IsNil)
 }
 
-// TestGetLiveChannelHistory()
+// TestGetLiveChannelHistory
 func (s *OssBucketLiveChannelSuite) TestGetLiveChannelHistory(c *C) {
 	channelName := "test-get-channel-history"
 
@@ -332,7 +332,7 @@ func (s *OssBucketLiveChannelSuite) TestListLiveChannel(c *C) {
 	}
 }
 
-// TestPostVodPlaylist
+// TestSignRtmpURL
 func (s *OssBucketLiveChannelSuite) TestSignRtmpURL(c *C) {
 	channelName := "test-sign-rtmp-url"
 	playlistName := "test-sign-rtmp-url.m3u8"
@@ -363,7 +363,7 @@ func (s *OssBucketLiveChannelSuite) TestSignRtmpURL(c *C) {
 }
 
 // private
-// getPlayURL - 获取直播流频道的播放地址
+// getPlayURL Get the play url of the live channel
 func getPlayURL(bucketName, channelName, playlistName string) string {
 	host := ""
 	useHTTPS := false
@@ -382,7 +382,7 @@ func getPlayURL(bucketName, channelName, playlistName string) string {
 	return fmt.Sprintf("http://%s.%s/%s/%s", bucketName, host, channelName, playlistName)
 }
 
-// getPublistURL - 获取直播流频道的推流地址
+// getPublistURL Get the push url of the live stream channel
 func getPublishURL(bucketName, channelName string) string {
 	host := ""
 	if strings.Contains(endpoint, "https://") {

+ 54 - 55
oss/type.go

@@ -449,101 +449,100 @@ type createBucketConfiguration struct {
 	StorageClass StorageClassType `xml:"StorageClass,omitempty"`
 }
 
-// LiveChannelConfiguration livechannel的配置信息
+// LiveChannelConfiguration defines the configuration for live-channel
 type LiveChannelConfiguration struct {
 	XMLName     xml.Name          `xml:"LiveChannelConfiguration"`
-	Description string            `xml:"Description,omitempty"` //livechannel的描述信息,最长128字节
-	Status      string            `xml:"Status,omitempty"`      //指定livechannel的状态
-	Target      LiveChannelTarget `xml:"Target"`                //保存转储配置的容器
-	//Snapshot    LiveChannelSnapshot `xml:"Snapshot,omitempty"` //保存高频截图操作Snapshot选项的容器
+	Description string            `xml:"Description,omitempty"` //Description of live-channel, up to 128 bytes
+	Status      string            `xml:"Status,omitempty"`      //Specify the status of livechannel
+	Target      LiveChannelTarget `xml:"Target"`                //target configuration of live-channel
+	// use point instead of struct to avoid omit empty snapshot
+	Snapshot *LiveChannelSnapshot `xml:"Snapshot,omitempty"` //snapshot configuration of live-channel
 }
 
-// LiveChannelTarget livechannel的转储配置信息
+// LiveChannelTarget target configuration of live-channel
 type LiveChannelTarget struct {
 	XMLName      xml.Name `xml:"Target"`
-	Type         string   `xml:"Type"`                   //指定转储的类型,只支持HLS
-	FragDuration int      `xml:"FragDuration,omitempty"` //当Type为HLS时,指定每个ts文件的时长(单位:秒),取值范围为【1,100】的整数
-	FragCount    int      `xml:"FragCount,omitempty"`    //当Type为HLS时,指定m3u8文件中包含ts文件的个数,取值范围为【1,100】的整数
-	PlaylistName string   `xml:"PlaylistName,omitempty"` //当Type为HLS时,指定生成m3u8文件的名称,必须以“.m3u8”结尾,长度范围为【6,128】
+	Type         string   `xml:"Type"`                   //the type of object, only supports HLS
+	FragDuration int      `xml:"FragDuration,omitempty"` //the length of each ts object (in seconds), in the range [1,100]
+	FragCount    int      `xml:"FragCount,omitempty"`    //the number of ts objects in the m3u8 object, in the range of [1,100]
+	PlaylistName string   `xml:"PlaylistName,omitempty"` //the name of m3u8 object, which must end with ".m3u8" and the length range is [6,128]
 }
 
-/*
-// LiveChannelSnapshot livechannel关于高频截图操作snapshot的配置信息
+// LiveChannelSnapshot snapshot configuration of live-channel
 type LiveChannelSnapshot struct {
 	XMLName     xml.Name `xml:"Snapshot"`
-	RoleName    string   `xml:"RoleName,omitempty"`    //高频截图操作的角色名称,要求有DestBucket的写权限和向NotifyTopic发消息的权限
-	DestBucket  string   `xml:"DestBucket,omitempty"`  //保存高频截图的目标Bucket,要求与当前Bucket是同一个Owner
-	NotifyTopic string   `xml:"NotifyTopic,omitempty"` //用于通知用户高频截图操作结果的MNS的Topic
-	Interval    int      `xml:"Interval,omitempty"`    //高频截图的间隔长度,单位为s,如果该段间隔时间内没有关键帧(I帧),那么该间隔时间不截图
+	RoleName    string   `xml:"RoleName,omitempty"`    //The role of snapshot operations, it sholud has write permission of DestBucket and the permission to send messages to the NotifyTopic.
+	DestBucket  string   `xml:"DestBucket,omitempty"`  //Bucket the snapshots will be written to. should be the same owner as the source bucket.
+	NotifyTopic string   `xml:"NotifyTopic,omitempty"` //Topics of MNS for notifying users of high frequency screenshot operation results
+	Interval    int      `xml:"Interval,omitempty"`    //interval of snapshots, threre is no snapshot if no I-frame during the interval time
 }
-*/
 
-// CreateLiveChannelResult 创建livechannel请求的返回结果
+// CreateLiveChannelResult the result of crete live-channel
 type CreateLiveChannelResult struct {
 	XMLName     xml.Name `xml:"CreateLiveChannelResult"`
-	PublishUrls []string `xml:"PublishUrls>Url"` //推流地址列表
-	PlayUrls    []string `xml:"PlayUrls>Url"`    //播放地址的列表
+	PublishUrls []string `xml:"PublishUrls>Url"` //push urls list
+	PlayUrls    []string `xml:"PlayUrls>Url"`    //play urls list
 }
 
-// LiveChannelStat 获取livechannel状态请求的返回结果
+// LiveChannelStat the result of get live-channel state
 type LiveChannelStat struct {
 	XMLName       xml.Name         `xml:"LiveChannelStat"`
-	Status        string           `xml:"Status"`        //livechannel当前推流的状态,Disabled, Live, Idle
-	ConnectedTime time.Time        `xml:"ConnectedTime"` //当Status为Live时,表示当前客户开始推流的时间,使用ISO8601格式表示
-	RemoteAddr    string           `xml:"RemoteAddr"`    //当Status为Live时,表示当前推流客户端的ip地址
-	Video         LiveChannelVideo `xml:"Video"`         //当Status为Live时,表示视频流的信息
-	Audio         LiveChannelAudio `xml:"Audio"`         //当Status为Live时, 表示音频流的信息
+	Status        string           `xml:"Status"`        //Current push status of live-channel: Disabled,Live,Idle
+	ConnectedTime time.Time        `xml:"ConnectedTime"` //The time when the client starts pushing, format: ISO8601
+	RemoteAddr    string           `xml:"RemoteAddr"`    //The ip address of the client
+	Video         LiveChannelVideo `xml:"Video"`         //Video stream information
+	Audio         LiveChannelAudio `xml:"Audio"`         //Audio stream information
 }
 
-// LiveChannelVideo 当livechannel的状态为live时,livechannel视频流的信息
+// LiveChannelVideo video stream information
 type LiveChannelVideo struct {
 	XMLName   xml.Name `xml:"Video"`
-	Width     int      `xml:"Width"`     //视频流的画面宽度(单位:像素)
-	Height    int      `xml:"Height"`    //视频流的画面高度(单位:像素)
-	FrameRate int      `xml:"FrameRate"` //视频流的帧率
-	Bandwidth int      `xml:"Bandwidth"` //视频流的码率(单位:B/s)
+	Width     int      `xml:"Width"`     //Width (unit: pixels)
+	Height    int      `xml:"Height"`    //Height (unit: pixels)
+	FrameRate int      `xml:"FrameRate"` //FramRate
+	Bandwidth int      `xml:"Bandwidth"` //Bandwidth (unit: B/s)
 }
 
-// LiveChannelAudio 当livechannel的状态为live时,livechannel音频流的信息
+// LiveChannelAudio audio stream information
 type LiveChannelAudio struct {
 	XMLName    xml.Name `xml:"Audio"`
-	SampleRate int      `xml:"SampleRate"` //音频流的采样率
-	Bandwidth  int      `xml:"Bandwidth"`  //音频流的码率(单位:B/s)
-	Codec      string   `xml:"Codec"`      //音频流的编码格式
+	SampleRate int      `xml:"SampleRate"` //SampleRate
+	Bandwidth  int      `xml:"Bandwidth"`  //Bandwidth (unit: B/s)
+	Codec      string   `xml:"Codec"`      //Encoding forma
 }
 
-// LiveChannelHistory - livechannel的历史所有推流记录,目前最多会返回指定livechannel最近10次的推流记录
+// LiveChannelHistory the result of GetLiveChannelHistory, at most return up to lastest 10 push records
 type LiveChannelHistory struct {
 	XMLName xml.Name     `xml:"LiveChannelHistory"`
-	Record  []LiveRecord `xml:"LiveRecord"` //单个推流记录
+	Record  []LiveRecord `xml:"LiveRecord"` //push records list
 }
 
-// LiveRecord - 单个推流记录
+// LiveRecord push recode
 type LiveRecord struct {
 	XMLName    xml.Name  `xml:"LiveRecord"`
-	StartTime  time.Time `xml:"StartTime"`  //推流开始时间,使用ISO8601格式表示
-	EndTime    time.Time `xml:"EndTime"`    //推流结束时间,使用ISO8601格式表示
-	RemoteAddr string    `xml:"RemoteAddr"` //推流客户端的ip地址
+	StartTime  time.Time `xml:"StartTime"`  //StartTime, format: ISO8601
+	EndTime    time.Time `xml:"EndTime"`    //EndTime, format: ISO8601
+	RemoteAddr string    `xml:"RemoteAddr"` //The ip address of remote client
 }
 
-// ListLiveChannelResult -
+// ListLiveChannelResult the result of ListLiveChannel
 type ListLiveChannelResult struct {
 	XMLName     xml.Name          `xml:"ListLiveChannelResult"`
-	Prefix      string            `xml:"Prefix"`      //返回以prifix作为前缀的livechannel,注意使用prifix查询时,返回的key中仍会包含prifix
-	Marker      string            `xml:"Marker"`      //以marker之后按字母排序的第一个livechanel开始返回
-	MaxKeys     int               `xml:"MaxKeys"`     //返回livechannel的最大数,如果不设定,默认为100,max-key的取值不能大于1000
-	IsTruncated bool              `xml:"IsTruncated"` //指明是否所有的结果都已经返回,“true”表示本次没有返回全部结果,“false”则表示已经返回了全部结果
-	NextMarker  string            `xml:"NextMarker"`  //如果本次没有返回全部结果,NextMarker用于表明下一请求的Marker值
-	LiveChannel []LiveChannelInfo `xml:"LiveChannel"` //livechannel的基本信息
+	Prefix      string            `xml:"Prefix"`      //Filter by the name start with the value of "Prefix"
+	Marker      string            `xml:"Marker"`      //cursor from which starting list
+	MaxKeys     int               `xml:"MaxKeys"`     //The maximum count returned. the default value is 100. it cannot be greater than 1000.
+	IsTruncated bool              `xml:"IsTruncated"` //Indicates whether all results have been returned, "true" indicates partial results returned while "false" indicates all results have been returned
+	NextMarker  string            `xml:"NextMarker"`  //NextMarker indicate the Marker value of the next request
+	LiveChannel []LiveChannelInfo `xml:"LiveChannel"` //The infomation of live-channel
 }
 
-// LiveChannelInfo -
+// LiveChannelInfo the infomation of live-channel
 type LiveChannelInfo struct {
 	XMLName      xml.Name  `xml:"LiveChannel"`
-	Name         string    `xml:"Name"`            //livechannel的名称
-	Description  string    `xml:"Description"`     //livechannel的描述信息
-	Status       string    `xml:"Status"`          //livechannel的状态,有效值:disabled, enabled
-	LastModified time.Time `xml:"LastModified"`    //livechannel的最后修改时间,使用ISO8601格式表示
-	PublishUrls  []string  `xml:"PublishUrls>Url"` //推流地址列表
-	PlayUrls     []string  `xml:"PlayUrls>Url"`    //播放地址列表
+	Name         string    `xml:"Name"`            //The name of live-channel
+	Description  string    `xml:"Description"`     //Description of live-channel
+	Status       string    `xml:"Status"`          //Status: disabled or enabled
+	LastModified time.Time `xml:"LastModified"`    //Last modification time, format: ISO8601
+	PublishUrls  []string  `xml:"PublishUrls>Url"` //push urls list
+	PlayUrls     []string  `xml:"PlayUrls>Url"`    //play urls list
 }

+ 37 - 35
sample/livechannel.go

@@ -7,24 +7,24 @@ import (
 	"github.com/aliyun/aliyun-oss-go-sdk/oss"
 )
 
-// CreateLiveChannelSample - 创建livechannel的sample
+// CreateLiveChannelSample Samples for create a live-channel
 func CreateLiveChannelSample() {
 	channelName := "create-livechannel"
-	//创建bucket
+	//create bucket
 	bucket, err := GetTestBucket(bucketName)
 	if err != nil {
 		HandleError(err)
 	}
 
-	// 场景1 - 完整配置livechannel创建
+	// Case 1 - Create live-channel with Completely configure
 	config := oss.LiveChannelConfiguration{
-		Description: "sample-for-livechannel", //livechannel的描述信息,最长128字节,非必须
-		Status:      "enabled",                //指定livechannel的状态,非必须(默认值:"enabled", 值只能是"enabled", "disabled")
+		Description: "sample-for-livechannel", //description information, up to 128 bytes
+		Status:      "enabled",                //enabled or disabled
 		Target: oss.LiveChannelTarget{
-			Type:         "HLS",                          //指定转储的类型,只支持HLS, 必须
-			FragDuration: 10,                             //指定每个ts文件的时长(单位:秒),取值范围为【1,100】的整数, 非必须(默认值:5)
-			FragCount:    4,                              //指定m3u8文件中包含ts文件的个数,取值范围为【1,100】的整数,非必须(默认值:3)
-			PlaylistName: "test-get-channel-status.m3u8", //当Type为HLS时,指定生成m3u8文件的名称,必须以“.m3u8”结尾,长度范围为【6,128】,非必须(默认值:playlist.m3u8)
+			Type:         "HLS",                          //the type of object, only supports HLS, required
+			FragDuration: 10,                             //the length of each ts object (in seconds), in the range [1,100], default: 5
+			FragCount:    4,                              //the number of ts objects in the m3u8 object, in the range of [1,100], default: 3
+			PlaylistName: "test-get-channel-status.m3u8", //the name of m3u8 object, which must end with ".m3u8" and the length range is [6,128],default: playlist.m3u8
 		},
 	}
 
@@ -37,7 +37,7 @@ func CreateLiveChannelSample() {
 	publishURL := result.PublishUrls[0]
 	fmt.Printf("create livechannel:%s  with config respones: playURL:%s, publishURL: %s\n", channelName, playURL, publishURL)
 
-	// 场景2 - 简单配置livechannel创建
+	// Case 2 - Create live-channel only specified type of target which is required
 	simpleCfg := oss.LiveChannelConfiguration{
 		Target: oss.LiveChannelTarget{
 			Type: "HLS",
@@ -59,7 +59,7 @@ func CreateLiveChannelSample() {
 	fmt.Println("PutObjectSample completed")
 }
 
-// PutLiveChannelStatusSample - 设置直播频道的状态的sample,有两种状态可选:enabled和disabled
+// PutLiveChannelStatusSample Set the status of the live-channel sample: enabled/disabled
 func PutLiveChannelStatusSample() {
 	channelName := "put-livechannel-status"
 	bucket, err := GetTestBucket(bucketName)
@@ -69,7 +69,7 @@ func PutLiveChannelStatusSample() {
 
 	config := oss.LiveChannelConfiguration{
 		Target: oss.LiveChannelTarget{
-			Type: "HLS", //指定转储的类型,只支持HLS, 必须
+			Type: "HLS", //the type of object, only supports HLS, required
 		},
 	}
 
@@ -78,13 +78,13 @@ func PutLiveChannelStatusSample() {
 		HandleError(err)
 	}
 
-	// 场景1 - 设置livechannel的状态为disabled
+	// Case 1 - Set the status of live-channel to disabled
 	err = bucket.PutLiveChannelStatus(channelName, "disabled")
 	if err != nil {
 		HandleError(err)
 	}
 
-	// 场景2 - 设置livechannel的状态为enalbed
+	// Case 2 - Set the status of live-channel to enabled
 	err = bucket.PutLiveChannelStatus(channelName, "enabled")
 	if err != nil {
 		HandleError(err)
@@ -98,7 +98,7 @@ func PutLiveChannelStatusSample() {
 	fmt.Println("PutLiveChannelStatusSample completed")
 }
 
-// PostVodPlayListSample - 生成点播列表的sample
+// PostVodPlayListSample Sample for generate playlist
 func PostVodPlayListSample() {
 	channelName := "post-vod-playlist"
 	playlistName := "playlist.m3u8"
@@ -109,7 +109,7 @@ func PostVodPlayListSample() {
 
 	config := oss.LiveChannelConfiguration{
 		Target: oss.LiveChannelTarget{
-			Type:         "HLS", //指定转储的类型,只支持HLS, 必须
+			Type:         "HLS", //the type of object, only supports HLS, required
 			PlaylistName: "playlist.m3u8",
 		},
 	}
@@ -119,7 +119,7 @@ func PostVodPlayListSample() {
 		HandleError(err)
 	}
 
-	//这个阶段可以推流了...
+	//This stage you can push live stream, and after that you could generator playlist
 
 	endTime := time.Now().Add(-1 * time.Minute)
 	startTime := endTime.Add(-60 * time.Minute)
@@ -136,7 +136,7 @@ func PostVodPlayListSample() {
 	fmt.Println("PostVodPlayListSampleSample completed")
 }
 
-// GetLiveChannelStatSample - 获取指定直播流频道当前推流的状态的sample
+// GetLiveChannelStatSample Sample for get the state of live-channel
 func GetLiveChannelStatSample() {
 	channelName := "get-livechannel-stat"
 	bucket, err := GetTestBucket(bucketName)
@@ -146,7 +146,7 @@ func GetLiveChannelStatSample() {
 
 	config := oss.LiveChannelConfiguration{
 		Target: oss.LiveChannelTarget{
-			Type: "HLS", //指定转储的类型,只支持HLS, 必须
+			Type: "HLS", //the type of object, only supports HLS, required
 		},
 	}
 
@@ -183,7 +183,7 @@ func GetLiveChannelStatSample() {
 	fmt.Println("GetLiveChannelStatSample completed")
 }
 
-// GetLiveChannelInfoSample - 获取直播流频道的配置信息的sample
+// GetLiveChannelInfoSample Sample for get the configuration infomation of live-channel
 func GetLiveChannelInfoSample() {
 	channelName := "get-livechannel-info"
 	bucket, err := GetTestBucket(bucketName)
@@ -193,7 +193,7 @@ func GetLiveChannelInfoSample() {
 
 	config := oss.LiveChannelConfiguration{
 		Target: oss.LiveChannelTarget{
-			Type: "HLS", //指定转储的类型,只支持HLS, 必须
+			Type: "HLS", //the type of object, only supports HLS, required
 		},
 	}
 
@@ -224,7 +224,7 @@ func GetLiveChannelInfoSample() {
 	fmt.Println("GetLiveChannelInfoSample completed")
 }
 
-// GetLiveChannelHistorySample - 获取直播流频道的历史推流记录的sample
+// GetLiveChannelHistorySample  Sample for get push records of live-channel
 func GetLiveChannelHistorySample() {
 	channelName := "get-livechannel-info"
 	bucket, err := GetTestBucket(bucketName)
@@ -234,7 +234,7 @@ func GetLiveChannelHistorySample() {
 
 	config := oss.LiveChannelConfiguration{
 		Target: oss.LiveChannelTarget{
-			Type: "HLS", //指定转储的类型,只支持HLS, 必须
+			Type: "HLS", //the type of object, only supports HLS, required
 		},
 	}
 
@@ -243,7 +243,7 @@ func GetLiveChannelHistorySample() {
 		HandleError(err)
 	}
 
-	//目前最多会返回指定LiveChannel最近的10次推流记录
+	//at most return up to lastest 10 push records
 	history, err := bucket.GetLiveChannelHistory(channelName)
 	for _, record := range history.Record {
 		remoteAddr := record.RemoteAddr
@@ -260,7 +260,7 @@ func GetLiveChannelHistorySample() {
 	fmt.Println("GetLiveChannelHistorySample completed")
 }
 
-// ListLiveChannelSample - 获取当前bucket下直播流频道的信息列表的sample
+// ListLiveChannelSample Samples for list live-channels with specified bucket name
 func ListLiveChannelSample() {
 	channelName := "list-livechannel"
 	bucket, err := GetTestBucket(bucketName)
@@ -270,7 +270,7 @@ func ListLiveChannelSample() {
 
 	config := oss.LiveChannelConfiguration{
 		Target: oss.LiveChannelTarget{
-			Type: "HLS", //指定转储的类型,只支持HLS, 必须
+			Type: "HLS", //the type of object, only supports HLS, required
 		},
 	}
 
@@ -279,10 +279,11 @@ func ListLiveChannelSample() {
 		HandleError(err)
 	}
 
-	// 场景1:列出当前bucket下所有的livechannel
+	// Case 1: list all the live-channels
 	marker := ""
 	for {
-		//设定marker值,第一次执行时为”“,后续执行时以返回结果的nextmarker的值作为marker的值
+		// Set the marker value, the first time is "", the value of NextMarker that returned should as the marker in the next time
+		// At most return up to lastest 100 live-channels if "max-keys" is not specified
 		result, err := bucket.ListLiveChannel(oss.Marker(marker))
 		if err != nil {
 			HandleError(err)
@@ -299,7 +300,8 @@ func ListLiveChannelSample() {
 		}
 	}
 
-	// 场景2:使用参数”max-keys“指定返回记录的最大个数, 但max-keys的值不能超过1000
+	// Case 2: Use the parameter "max-keys" to specify the maximum number of records returned, the value of max-keys cannot exceed 1000
+	// if "max-keys" the default value is 100
 	result, err := bucket.ListLiveChannel(oss.MaxKeys(10))
 	if err != nil {
 		HandleError(err)
@@ -308,8 +310,8 @@ func ListLiveChannelSample() {
 		fmt.Printf("list livechannel: (%v, %v, %v, %v, %v, %v)\n", channel.Name, channel.Status, channel.Description, channel.LastModified, channel.PlayUrls[0], channel.PublishUrls[0])
 	}
 
-	// 场景3;使用参数”prefix“过滤只列出包含”prefix“的值作为前缀的livechannel
-	// max-keys, prefix, maker参数可以组合使用
+	// Case 3: Only list the live-channels with the value of parameter "prefix" as prefix
+	// max-keys, prefix, maker parameters can be combined
 	result, err = bucket.ListLiveChannel(oss.MaxKeys(10), oss.Prefix("list-"))
 	if err != nil {
 		HandleError(err)
@@ -326,7 +328,7 @@ func ListLiveChannelSample() {
 	fmt.Println("ListLiveChannelSample completed")
 }
 
-// DeleteLiveChannelSample - 删除直播频道的信息列表的sample
+// DeleteLiveChannelSample Sample for delete live-channel
 func DeleteLiveChannelSample() {
 	channelName := "delete-livechannel"
 	bucket, err := GetTestBucket(bucketName)
@@ -336,7 +338,7 @@ func DeleteLiveChannelSample() {
 
 	config := oss.LiveChannelConfiguration{
 		Target: oss.LiveChannelTarget{
-			Type: "HLS", //指定转储的类型,只支持HLS, 必须
+			Type: "HLS", //the type of object, only supports HLS, required
 		},
 	}
 
@@ -358,7 +360,7 @@ func DeleteLiveChannelSample() {
 	fmt.Println("DeleteLiveChannelSample completed")
 }
 
-// SignRtmpURLSample - 创建签名推流地址的sample
+// SignRtmpURLSample Sample for generate a RTMP push-stream signature URL for the trusted user to push the RTMP stream to the live channel.
 func SignRtmpURLSample() {
 	channelName := "sign-rtmp-url"
 	playlistName := "playlist.m3u8"
@@ -369,7 +371,7 @@ func SignRtmpURLSample() {
 
 	config := oss.LiveChannelConfiguration{
 		Target: oss.LiveChannelTarget{
-			Type:         "HLS", //指定转储的类型,只支持HLS, 必须
+			Type:         "HLS", //the type of object, only supports HLS, required
 			PlaylistName: "playlist.m3u8",
 		},
 	}