// ==UserScript==
// @name 115 Online Player
// @version 1.1
// @description Play videos from 115 online
// @match http://*.115.com/*
// @match http://*.115.com/*
// @author 8qwe24657913 | 864907600cc
// @run-at document-end
// @grant none
// @namespace http://ext.ccloli.com
// @downloadURL none
// ==/UserScript==
// 播放的视频系未转码的原始视频,播放视频需浏览器支持该格式,当浏览器无法播放此视频时会弹出视频下载地址,您可以将地址贴入本地播放器来在线观看,或贴入下载地址下载播放
if (location.search.indexOf("?ct=")) {
var requests = [],
CloudVideo = window.CloudVideo = {
showPanel: function (code, height) {
var dialog_frame = $('
Loading......
');
var dialog = new Core.DialogBase({
title: "视频播放",
content: dialog_frame,
width: 640
});
var video;
dialog._Close = dialog.Close;
dialog.Close = function(){
// 减少不必要的带宽消耗
// http://stackoverflow.com/questions/4071872/html5-video-force-abort-of-buffering
if (video) {
var video = video[0];
video.pause(0);
video.setAttribute('onerror', '');
video.setAttribute('src', '');
}
this._Close();
}
dialog.Open();
this.getFileUrl(code, function (url) {
video = $('').attr('src', url).appendTo(dialog_frame.html(''));
});
},
getFileUrl: function (pickcode, callback) {
requests.push([pickcode, callback]);
}
},
frameName = 'CloudVideo_' + new Date().getTime();
$('