@@ -100,7 +100,7 @@ function closeWin() {
100100 * @param clientY 相对窗口纵坐标
101101 * @param distance 滑动距离
102102 */
103- function dragandDrop ( btn_hk , clientX , clientY , distance ) {
103+ function dragandDrop ( btn_hk , clientX , clientY , distance ) {
104104 var elem = btn_hk ,
105105 k = 0 ,
106106 interval ;
@@ -111,13 +111,13 @@ function dragandDrop(btn_hk, clientX, clientY, distance) {
111111 iter ( k ) ;
112112 if ( k === distance ) {
113113 clearInterval ( interval ) ;
114- iME ( elem , "mouseup" , clientX + k , clientY , 220 + k , 400 ) ;
114+ iME ( elem , "mouseup" , clientX + k , clientY , 220 + k , 400 ) ;
115115 }
116116 } , waitTime ) ;
117117 function iter ( y ) {
118- iME ( elem , "mousemove" , clientX + y , clientY , clientX + y , clientY ) ;
118+ iME ( elem , "mousemove" , clientX + y , clientY , clientX + y , clientY ) ;
119119 }
120- function iME ( obj , event , screenXArg , screenYArg , clientXArg , clientYArg ) {
120+ function iME ( obj , event , screenXArg , screenYArg , clientXArg , clientYArg ) {
121121 var mousemove = document . createEvent ( "MouseEvent" ) ;
122122 mousemove . initMouseEvent ( event , true , true , unsafeWindow , 0 , screenXArg , screenYArg , clientXArg , clientYArg , 0 , 0 , 0 , 0 , 0 , null ) ;
123123 obj . dispatchEvent ( mousemove ) ;
@@ -236,36 +236,46 @@ function getVideoTag() {
236236 let video = null ;
237237 let pauseButton = null ;
238238 var u = navigator . userAgent ;
239- if ( u . indexOf ( 'Mac' ) > - 1 ) { //Mac
240- if ( iframe != null && iframe . innerHTML ) {
241- //如果有iframe,说明外面的video标签是假的
242- video = iframe . contentWindow . document . getElementsByTagName ( "video" ) [ 0 ] ;
243- pauseButton = iframe . contentWindow . document . getElementsByClassName ( "prism-play-btn" ) [ 0 ] ;
244- } else {
245- //否则这个video标签是真的
246- video = document . getElementsByTagName ( "video" ) [ 0 ] ;
247- pauseButton = document . getElementsByClassName ( "prism-play-btn" ) [ 0 ] ;
248- }
249- return {
250- "video" : video ,
251- "pauseButton" : pauseButton
252- }
253- }
254- else {
255- if ( iframe ) {
256- //如果有iframe,说明外面的video标签是假的
257- video = iframe . contentWindow . document . getElementsByTagName ( "video" ) [ 0 ] ;
258- pauseButton = iframe . contentWindow . document . getElementsByClassName ( "prism-play-btn" ) [ 0 ] ;
259- } else {
260- //否则这个video标签是真的
261- video = document . getElementsByTagName ( "video" ) [ 0 ] ;
262- pauseButton = document . getElementsByClassName ( "prism-play-btn" ) [ 0 ] ;
263- }
264- return {
265- "video" : video ,
266- "pauseButton" : pauseButton
267- }
239+
240+ // 视频播放按钮更新
241+ video = document . getElementsByTagName ( "video" ) [ 0 ] ;
242+ pauseButton = document . getElementsByClassName ( "prism-big-play-btn" ) [ 0 ] ;
243+
244+ return {
245+ "video" : video ,
246+ "pauseButton" : pauseButton
268247 }
248+
249+ // if (u.indexOf('Mac') > -1) {//Mac
250+ // if (iframe != null && iframe.innerHTML) {
251+ // //如果有iframe,说明外面的video标签是假的
252+ // video = iframe.contentWindow.document.getElementsByTagName("video")[0];
253+ // pauseButton = iframe.contentWindow.document.getElementsByClassName("prism-play-btn")[0];
254+ // } else {
255+ // //否则这个video标签是真的
256+ // video = document.getElementsByTagName("video")[0];
257+ // pauseButton = document.getElementsByClassName("prism-play-btn")[0];
258+ // }
259+ // return {
260+ // "video": video,
261+ // "pauseButton": pauseButton
262+ // }
263+ // }
264+ // else {
265+ // if (iframe) {
266+ // //如果有iframe,说明外面的video标签是假的
267+ // video = iframe.contentWindow.document.getElementsByTagName("video")[0];
268+ // pauseButton = iframe.contentWindow.document.getElementsByClassName("prism-play-btn")[0];
269+ // } else {
270+ // //否则这个video标签是真的
271+ // video = document.getElementsByTagName("video")[0];
272+ // pauseButton = document.getElementsByClassName("prism-play-btn")[0];
273+ // }
274+ // return {
275+ // "video": video,
276+ // "pauseButton": pauseButton
277+ // }
278+ // }
269279}
270280
271281//读新闻或者看视频
@@ -731,8 +741,8 @@ async function doingExam() {
731741 await waitRandomBetween ( 2 , 5 ) ;
732742 await doingPause ( ) ;
733743 nextButton = await getNextButton ( ) ;
734- if ( document . getElementsByClassName ( 'nc_iconfont btn_slide' ) [ 0 ] != null ) {
735- dragandDrop ( document . getElementsByClassName ( 'nc_iconfont btn_slide' ) [ 0 ] , 0 , 0 , 300 ) ;
744+ if ( document . getElementsByClassName ( 'nc_iconfont btn_slide' ) [ 0 ] != null ) {
745+ dragandDrop ( document . getElementsByClassName ( 'nc_iconfont btn_slide' ) [ 0 ] , 0 , 0 , 300 ) ;
736746 }
737747 if ( nextButton . textContent == "再练一次" || nextButton . textContent == "再来一组" || nextButton . textContent == "查看解析" ) {
738748 break ;
0 commit comments