
Tiện ích Ancplay hôm nay mình giới thiệu sẽ giúp các bạn khắc phục vấn đề trên.Ancplay được phát triển bởi Suzuki_aka, nó cho phép người xem dễ dàng xem nhiều video khác nhau trên bài viết của bạn. Hay nói dễ hiểu hơn nó giống như 1 trình xem video đơn giản, với 1 phần hiển thị video và 1 phần hiển thị danh sách các video. Các bạn chỉ việc click vào danh sách các video và xem. Hiện tại tiện ích hỗ trợ xem video từ các server : youtube.com, videobb.com, clip.vn, cyworld.vn, video.zing.vn, stream.pub.vn, dailymotion.com, videozer.com, 4shared.com, 2shared.com.
1. Vào trong code template (không cần nhấp mở rộng mẫu tiện ích), sau đó chèn đoạn code bên dưới vào trước thẻ đóng </body> , các bạn có thể chèn ở vị trí khác cũng được, nhưng bắt buộc phải chèn sau tiện ích Blog1 (phần hiển thị bài viết) :
<script src='http://fandung.googlecode.com/svn/trunk/js/ancplay-mp.js' type='text/javascript'/>
<script type='text/javascript'>
//<![CDATA[
M.pl(M.re("Blog1"),"anc_pl","anc_tp");
var anc_ida = M.re("Blog1").split('|')[0].split(';')[1];
$_("anc_content").innerHTML = $_("anc_nd").innerHTML;
var player_id = "player";
var player_width = 640;
var player_height = 420;
var player_stream = ""+anc_ida+"";
var params = {allowFullScreen: true, scale: 'scale', allowScriptAccess: 'always'};
var attributes = {id: player_id, name: player_id};
var player_dvrMinutes = 30;
swfobject.embedSWF('http://cdn.octoshape.net/resources/player/infinitehd/player1.swf', player_id, player_width,
player_height, "10.0.0", null, null, params, attributes);
function Rload(x){
player_stream = ""+x+"";
swfobject.embedSWF('http://cdn.octoshape.net/resources/player/infinitehd/player1.swf', player_id, player_width,
player_height, "10.0.0", null, null, params, attributes);
swfobject.addDomLoadEvent(fixReference);
}
//]]>
</script>
<script type='text/javascript'>
//<![CDATA[
M.pl(M.re("Blog1"),"anc_pl","anc_tp");
var anc_ida = M.re("Blog1").split('|')[0].split(';')[1];
$_("anc_content").innerHTML = $_("anc_nd").innerHTML;
var player_id = "player";
var player_width = 640;
var player_height = 420;
var player_stream = ""+anc_ida+"";
var params = {allowFullScreen: true, scale: 'scale', allowScriptAccess: 'always'};
var attributes = {id: player_id, name: player_id};
var player_dvrMinutes = 30;
swfobject.embedSWF('http://cdn.octoshape.net/resources/player/infinitehd/player1.swf', player_id, player_width,
player_height, "10.0.0", null, null, params, attributes);
function Rload(x){
player_stream = ""+x+"";
swfobject.embedSWF('http://cdn.octoshape.net/resources/player/infinitehd/player1.swf', player_id, player_width,
player_height, "10.0.0", null, null, params, attributes);
swfobject.addDomLoadEvent(fixReference);
}
//]]>
</script>
Update (30/11/2011) : đã fix code javascript, do 1 số template không có thẻ div có id là wrap2, nên mình đã sửa wrap2 thành Blog1 là ổn nhất.
Update (1/12/2011 bởi HellloXimo) : Hoàn thiện tiện ích hơn với 1 số tính năng đã được fix như :
- Fix play Full Sreen tất cả Server
- Fix play server Zing, Daily
- và đây là link file js : http://maphim-net.googlecode.com/svn/trunk/ancplay.js
2. Save template lại.
Như vậy đã xong bước chèn tiện ích vào blog. bây giờ mình giới thiệu qua cách post bài viết.
Để trình xem video hiển thị được, bắt buộc bài viết của bạn phải tuân theo mẫu bên dưới :
{Một vài thông tin về video - vị trí 1 }
<div align="center" id="anc_pl"></div>
<div id="anc_tp"></div>
<div id="anc_content"></div>
{Một vài thông tin về video - vị trí 2 }
id]1;link video 1|2;link video 2|[/id
- Thông tin về video các bạn có thể đặt ở vị trí 1 hoặc 2 tùy thích. Tùy vào cách bố trí bài viết của các bạn, hoặc có thể sử dụng đồng thời 2 vị trí cùng 1 lúc cũng được.<div align="center" id="anc_pl"></div>
<div id="anc_tp"></div>
<div id="anc_content"></div>
{Một vài thông tin về video - vị trí 2 }
id]1;link video 1|2;link video 2|[/id
- phần code highlight là code bắt buộc có trong bài viết.
- Sau đây là hướng dẫn chèn link video vào bài viết. Như trong đoạn code trên ta thấy, chèn link vào bài viết có dạng như bên dưới :
[id]1;link video1|2;link video2|[/id]
- Ví dụ ta có 2 link từ youtube và 2 link từ dailymotion và code mẫu như bên dưới :
[id]1;link youtube1|2;link youtube2|1;link dailymotion1|2;link dailymotion2|[/id]
và phần hiển thị sẽ trông như thế này :
Server Youtube: 1 | 2 |
Server Daily: 1 | 2 |
- Nếu ta thay số 1 và 2 thành Tập 1 và Tập 2 như bên dưới :Server Daily: 1 | 2 |
[id]Tập 1;link youtube1|Tập 2;link youtube2|Tập 1;link dailymotion1|Tập 2;link dailymotion2|[/id]
thì phần hiển thị sẽ là như thế này :
Server Youtube: Tập 1 | Tập 2 |
Server Daily: Tập 1 | Tập 2 |
- nếu Tập 1 được chia làm nhiều phần nhỏ thì ta cứ thêm tuần tự link vào, và các link được ngăn cách bằng dấu chấm phẩy. ví dụ như bên dưới :Server Daily: Tập 1 | Tập 2 |
[id]Tập 1;link youtube1-a;link youtube1-b;link youtube1-c;link youtube1-d|Tập 2;link youtube2|Tập 1;link dailymotion1|Tập 2;link dailymotion2|[/id]
- thì phần hiển thị sẽ như thế này :
Server Youtube: Tập 1a | Tập 1b | Tập 1c | Tập 1d | Tập 2 |
Server Daily: Tập 1 | Tập 2 |
Server Daily: Tập 1 | Tập 2 |
- Tương tự như thế, nếu video có từ nhiều nguồn thì ta cứ việc thêm vào phía sau nó. ví dụ như bên dưới :
[id]Tập 1;link youtube1-a;link youtube1-b;link youtube1-c;link youtube1-d|Tập 2;link youtube2|Tập 1;link dailymotion1|Tập 2;link dailymotion2|1;link zingmovie1|2;link zingmovie2[/id]
- và phần hiển thị sẽ là :
Server Youtube: Tập 1a | Tập 1b | Tập 1c | Tập 1d | Tập 2 |
Server Daily: Tập 1 | Tập 2 |
Server Zing: 1 | 2 |
Server Daily: Tập 1 | Tập 2 |
Server Zing: 1 | 2 |
Như vậy mình đã giới thiệu xong. chúc các bạn thành công.
Thủ thuật thực hiện theo yêu cầu của ChipKool_Online
Thanks to Suzuki_aka
0 Nhận xét