-
Notifications
You must be signed in to change notification settings - Fork 124
/
Copy pathdemo3.html
314 lines (263 loc) · 10.4 KB
/
demo3.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
<!DOCTYPE html>
<html lang="zh-cn">
<head>
<meta charset="utf-8">
<title>QQ音乐MV进阶体验</title>
<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=0" />
<link rel="stylesheet" href="http://imgcache.gtimg.cn/mediastyle/mobile/event/20150129_double_language_mv/index.css?max_age=2592000" />
<style type="text/css">
.mod_loading .content .progress span{-webkit-transition:width 0.4s linear;}
</style>
</head>
<body class="bodybox">
<div class="wrap" id="wrap">
<div class="item item-1">
<div class="box">
<div class="invite">
<div class="open_bg_before"></div>
<div class="open_bg_after"></div>
<div class="open_content"></div>
<div class="logo"></div>
</div>
</div>
</div>
<div class="item item-2">
<div class="box">
<p class="mod_text">小时候 我们与世界相隔10000公里</p>
<div class="mod_video js-play-mv" data-vid="u00156bge4r" data-mvname="Beat It" data-mvsinger="Michael Jackson">
<img src="http://imgcache.gtimg.cn/mediastyle/mobile/event/20150129_double_language_mv/img/video_bg_1.png"/>
<a class="btn_play" href="javascript:;">播放</a>
</div>
<img class="mod_des_bg" src="http://imgcache.gtimg.cn/mediastyle/mobile/event/20150129_double_language_mv/img/des_bg_1.png"/>
</div>
</div>
<div class="item item-3">
<div class="box">
<p class="mod_text">长大后 1米长的网线将我们连接到一起 </p>
<div class="mod_video js-play-mv" data-vid="n0015g6qpkn" data-mvname="Till The World Ends" data-mvsinger="Britney Spears">
<img src="http://imgcache.gtimg.cn/mediastyle/mobile/event/20150129_double_language_mv/img/video_bg_2.png"/>
<a class="btn_play" href="javascript:;">播放</a>
</div>
<img class="mod_des_bg" src="http://imgcache.gtimg.cn/mediastyle/mobile/event/20150129_double_language_mv/img/des_bg_2.png"/>
</div>
</div>
<div class="item item-4">
<div class="box">
<p class="mod_text">现在,QQ音乐让你与世界 仅有一个指尖的距离 </p>
<div class="mod_video js-play-mv" data-vid="m0015ha2gvj" data-mvname="Blank Space" data-mvsinger="Taylor Swift">
<img src="http://imgcache.gtimg.cn/mediastyle/mobile/event/20150129_double_language_mv/img/video_bg_3.png"/>
<a class="btn_play" href="javascript:;">播放</a>
</div>
<img class="mod_des_bg" src="http://imgcache.gtimg.cn/mediastyle/mobile/event/20150129_double_language_mv/img/des_bg_3.png"/>
</div>
</div>
<div class="item item-5">
<div class="box">
<h2 class="mod_title hide">弹指间 看世界</h2>
<img src="http://imgcache.gtimg.cn/mediastyle/mobile/event/20150129_double_language_mv/img/text_special.png"/>
<a class="mod_btn btn_try js-play-mv" href="javascript:;" data-vid="i0015pdobwk" data-mvname="Uptown Funk" data-mvsinger="Mark Ronson">立即体验双语MV</a>
<p class="tips">
<span>TIPS:</span>立即打开QQ音乐客户端搜索"双语MV"<br/>即可体验更多双语MV
</p >
</div>
</div>
<div class="item item-6">
<div class="box">
<h2 class="mod_title">有奖活动</h2>
<div class="rules">
<h3>活动规则</h3>
<p>1、将页面分享至朋友圈,并截图发送至QQ音乐公众号(qqmusic)</p>
<p>2、活动时间:2015年2月3日-2月15日</p>
<p>3、中奖用户我们将通过微信通知,24小时内未回复则视为放弃中奖资格</p>
<p>4、改成腾讯公司保留在法律规定的范围内对上述规则进行解释的权利</p>
</div>
<a class="mod_btn btn_share" href="javascript:;">分享有奖</a>
<div class="gift">
<h3>活动奖品</h3>
<p>腾讯羊年公仔3个;正版CD专辑10张;年费绿钻10个</p>
<img src="http://imgcache.gtimg.cn/mediastyle/mobile/event/20150129_double_language_mv/img/gift.png"/>
</div>
</div>
</div>
</div>
<!-- 加载提示 _S -->
<div class="mod_loading" id="loading">
<div class="content">
<div class="progress"><span id="progress_bg" style="width:0;"></span></div>
<p>Loading...</p>
</div>
</div>
<!-- 加载提示 _E -->
<!-- 播放状态 _S -->
<div class="icon_sound off js-btn-bgsong"><i></i></div>
<!-- 播放状态 _E -->
<!-- 滑块 _S -->
<div class="global">
<div class="slider"><span></span></div>
</div>
<!-- 滑块 _E -->
<script type="text/javascript">
window.debug=true;
</script>
<script type="text/javascript" src="http://imgcache.gtimg.cn/music/h5/lib/js/zepto-1.0.min.js?_bid=299&max_age=2592000"></script>
<script type="text/javascript" src="http://imgcache.gtimg.cn/music/h5/lib/js/music-1.0.min.js?_bid=299&max_age=2592000"></script>
<script type="text/javascript" src="iSlider.js"></script>
<script>
var myslider=new iSlider({
index:0,
loadingImgs:[
'http://imgcache.gtimg.cn/mediastyle/mobile/event/20150129_double_language_mv/img/open_content.png?d=20150203165217',
'http://imgcache.gtimg.cn/mediastyle/mobile/event/20150129_double_language_mv/img/invite_bg.png?d=20150203165217',
'http://imgcache.gtimg.cn/mediastyle/mobile/event/20150129_double_language_mv/img/open_bg_after.png?d=20150203165217'
],
onloading:function (complete,total) {
this.$('#progress_bg').style.width=complete/total*100+'%';
if (complete==total) {
this.$('#loading').style.display="none"
}
}
});
//背景音乐模块
var bgsongid='464695';
if ($.browser.music) {
M.musicReady(function () {
$('.js-btn-bgsong').on('touchstart',function () {
if ($(this).hasClass('off')) {
M.bridge.callHandler("music_resume",{}, function(res){ });
}else {
M.bridge.callHandler("music_pause",{}, function(res){ });
}
})
M.bridge.callHandler("query_songinfo",{}, function(res){
M.bridge.callHandler('23', {
'k1' : 0,
'k2' : bgsongid,
'action' : 'backplay',
'actionp' : {}
}, function(data){
})
if (res.code==0 && res.data) {
if (res.data.state=='pause') {
$('.js-btn-bgsong').addClass('off')
}else {
$('.js-btn-bgsong').removeClass('off')
}
}
$('.js-btn-bgsong').show();
});
M.bridge.onAPP("register_musicstate", function(res){
if (res.code==0 && res.data) {
if (res.data.state=='pause') {
$('.js-btn-bgsong').addClass('off')
}else {
$('.js-btn-bgsong').removeClass('off')
}
}
});
})
}else {
if (!M.audio) {
M.audio = document.createElement('audio');
document.body.appendChild(M.audio);
}
M.audio.src='http://ws.stream.qqmusic.qq.com/'+bgsongid+'.m4a?fromtag=30';
$(M.audio).on('pause',function () {
$('.js-btn-bgsong').addClass('off')
}).on('playing',function () {
$('.js-btn-bgsong').removeClass('off');
}).on('canplay',function () { //android2.3 不能直接播放 只能在canplay的时候 调用play()
M.audio.play();
});
$('.js-btn-bgsong').on('touchstart', function (e) {
e.preventDefault();
if (/off/.test(this.className)) {
M.audio.play();
$('.js-btn-bgsong').addClass('off')
}else {
M.audio.pause();
$('.js-btn-bgsong').removeClass('off');
}
return false;
});
$(document).on('touchstart',function () {
M.audio.play();
})
}
function base64Encode(input) {
var keyStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
var output = "";
var chr1, chr2, chr3, enc1, enc2, enc3, enc4;
var i = 0;
var string = input.replace(/\r\n/g, "\n");
input = "";
for (var n = 0; n < string.length; n++) {
var c = string.charCodeAt(n);
if (c < 128) {
input += String.fromCharCode(c);
} else if (c > 127 && c < 2048) {
input += String.fromCharCode(c >> 6 | 192);
input += String.fromCharCode(c & 63 | 128);
} else {
input += String.fromCharCode(c >> 12 | 224);
input += String.fromCharCode(c >> 6 & 63 | 128);
input += String.fromCharCode(c & 63 | 128);
}
}
while (i < input.length) {
chr1 = input.charCodeAt(i++);
chr2 = input.charCodeAt(i++);
chr3 = input.charCodeAt(i++);
enc1 = chr1 >> 2;
enc2 = (chr1 & 3) << 4 | chr2 >> 4;
enc3 = (chr2 & 15) << 2 | chr3 >> 6;
enc4 = chr3 & 63;
if (isNaN(chr2)) {
enc3 = enc4 = 64;
} else if (isNaN(chr3)) {
enc4 = 64;
}
output = output + keyStr.charAt(enc1) + keyStr.charAt(enc2) + keyStr.charAt(enc3) + keyStr.charAt(enc4);
}
return output;
}
$('.wrap').on('tap','.js-play-mv',function () {
var vid=this.getAttribute ('data-vid');
if (!vid) {
return ;
}
if ($.browser.music) {
M.bridgeCall('19',{
k2:vid,
k3:base64Encode(this.getAttribute ('data-mvname')),
k7:base64Encode(this.getAttribute ('data-mvsinger'))
},function () {
})
}else {
location.href='http://y.qq.com/w/mv.html?vid=' + vid;
}
}).on('tap','.js-open-music',function () {
if ($.browser.music) {
M.bridgeCall('16',{
k1:1,
k3:base64Encode('MV精选'),
k4:2009
},function () {
})
}else {
M.openMusic();
}
}).on('tap','.btn_share',function () {
M.share.call();
})
M.share.init({
title:'【QQ音乐双语MV】',
desc:'“译”动你我,极致体验',
link:M.delParam('mmkey',M.delParam('sid',location.href)),
img:'http://i.gtimg.cn/music/common/upload/msa/201523/28d24ec09ebb9d93cf331d8eaec217be.jpg'
})
$('#go1').click(function () {
myslider.slideTo(0)
})
</script>
</body>
</html>