• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*
2* Copyright (C) 2023 Huawei Device Co., Ltd.
3* Licensed under the Apache License, Version 2.0 (the "License");
4* you may not use this file except in compliance with the License.
5* You may obtain a copy of the License at
6*
7* http://www.apache.org/licenses/LICENSE-2.0
8*
9* Unless required by applicable law or agreed to in writing, software
10* distributed under the License is distributed on an "AS IS" BASIS,
11* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12* See the License for the specific language governing permissions and
13* limitations under the License.
14*/
15
16import avSession from '@ohos.multimedia.avsession';
17
18export default class MediaData {
19  queueItemDescFirst: avSession.AVMediaDescription = {
20    assetId: '001',
21    title: 'First music',
22    subtitle: 'music_sub_name',
23    description: 'music_description',
24    mediaImage: 'http://www.xxx.com',
25    extras: {
26      'extras': 'any'
27    }
28  };
29  queueItemFirst: avSession.AVQueueItem = {
30    itemId: 0,
31    description: this.queueItemDescFirst
32  };
33  queueItemDescSecond: avSession.AVMediaDescription = {
34    assetId: '002',
35    title: 'Second music',
36    subtitle: 'music_sub_name',
37    description: 'music_description',
38    mediaImage: 'http://www.xxx.com',
39    extras: {
40      'extras': 'any'
41    }
42  };
43  queueItemSecond: avSession.AVQueueItem = {
44    itemId: 1,
45    description: this.queueItemDescSecond
46  };
47  queueItemDescThird: avSession.AVMediaDescription = {
48    assetId: '003',
49    title: 'Third music',
50    subtitle: 'music_sub_name',
51    description: 'music_description',
52    mediaImage: 'http://www.xxx.com',
53    extras: {
54      'extras': 'any'
55    }
56  };
57  queueItemThird: avSession.AVQueueItem = {
58    itemId: 2,
59    description: this.queueItemDescThird
60  };
61  lyricsForDemo: Array<string> = [
62    'This is the first line of the lyrics',
63    'This is the second line of the lyrics',
64    'This is the third line of the lyrics',
65    'This is the fourth line of the lyrics',
66    'This is the fifth line of the lyrics',
67    'This is the sixth line of the lyrics',
68    'This is the seventh line of the lyrics',
69    'This is the eighth line of the lyrics',
70    'This is the ninth line of the lyrics',
71    'This is the tenth line of the lyrics',
72    'This is the eleventh line of the lyrics',
73    'This is the twelfth line of the lyrics',
74    'This is the thirteenth line of the lyrics',
75    'This is the fourteenth line of the lyrics',
76    'This is the fifteenth line of the lyrics',
77    'This is the sixteenth line of the lyrics',
78    'This is the seventeenth line of the lyrics',
79    'This is the eighteenth line of the lyrics',
80    'This is the nineteenth line of the lyrics',
81    'This is the twentieth line of the lyrics',
82    'This is the last line of the lyrics',
83  ]
84  avMetadataFirst: avSession.AVMetadata = {
85    assetId: '0',
86    title: this.queueItemDescFirst.title,
87    artist: 'First artist',
88    lyric: JSON.stringify(this.lyricsForDemo)
89  }
90  avMetadataSecond: avSession.AVMetadata = {
91    assetId: '1',
92    title: this.queueItemDescSecond.title,
93    artist: 'Second artist',
94    lyric: JSON.stringify(this.lyricsForDemo)
95  }
96  avMetadataThird: avSession.AVMetadata = {
97    assetId: '2',
98    title: this.queueItemDescThird.title,
99    artist: 'Third artist',
100    lyric: JSON.stringify(this.lyricsForDemo)
101  }
102  avMetadataList: Array<avSession.AVMetadata> = [this.avMetadataFirst, this.avMetadataSecond, this.avMetadataThird];
103}
104