Youtube play dialog

Platform:  mIRC
Published  Mar 04, 2012
Updated  Mar 04, 2012

Screenshots

................ Youtube viewer - settings
*/
dialog youviewsettings {
title "Youtube viewer - settings"
size -1 -1 104 62
option dbu
check "enabled", 1, 10 13 33 10
box "View youtube links in Youtube viewer", 2, 3 3 98 24
box "Size", 3, 3 28 73 31
edit "", 4, 5 38 32 10
edit "", 5, 42 38 32 10
text "X", 6, 38 40 4 8, center
text "width", 7, 7 47 25 8
text "height", 8, 44 47 25 8
button "SAVE", 9, 77 31 23 27
}
alias youviewsettings {
if (!$dialog(youviewsettings)) dialog -m youviewsettings youviewsettings
}
alias -l alert { .timer 1 0 noop $!input( $1- ,o,mIRC - Youtube viewer - settings) }
alias -l yset writeini youtubeview.ini $1 $2 $3-
alias -l yread return $readini(youtubeview.ini,$1,$2)
on *:dialog:youviewsettings:*:*: {
if ($devent == init) {
var %w = $yread(settings,w), %h = $yread(settings,h), %i = $yread(settings,i)
if (%w) did -a youviewsettings 4 %w
else did -a youviewsettings 4 850
if (%h) did -a youviewsettings 5 %h
else did -a youviewsettings 5 700
if (%i !== 0) did -c youviewsettings 1
}
elseif ($devent == sclick) {
if ($did == 9) {
var %w = $did(youviewsettings,4), %h = $did(youviewsettings,5), %i = $did(youviewsettings,1).state
yset settings i %i
if (%h) yset settings h %h
else remini youtubeview.ini settings h
if (%h) yset settings w %w
else remini youtubeview.ini settings w
alert Settings saved!
}
}
}
menu * {
Youtubesettings:youviewsettings
}

/*
Youtube viewer
*/
alias makyourl {
var %url = $1-
var %url = $right(%url,$calc($len(%url) - 1 - $pos(%url,v=,1)))
var %pos = $pos(%url,&,1)
if (%pos) var %url = $left(%url,$calc(%pos - 1))
return http://www.youtube.com/v/ $+ %url
}

alias youview {
var %w = $yread(settings,w), %h = $yread(settings,h)
var %url = $makyourl($1-)
write -c youview.html <html><body style="margin: 0px;" bgcolor="black" Scroll="No"><div style="position:absolute; top: -18px;"><object width=" $+ %w $+ " height=" $+ %h $+ "><param name="movie" value=" $+ %url $+ "></param><param name="wmode" value="transparent"></param><embed src=" $+ %url $+ " type="application/x-shockwave-flash" wmode="transparent" width=" $+ %w $+ " height=" $+ %h $+ "></embed></object></div></body></html>
if (!$dialog(youview)) {
dialog -m youview youview
}
xdid -n youview 1 $mircdir $+ youview.html
}
dialog youview {
title "Youtube viewer"
size 100 100 $yread(settings,w) $calc($yread(settings,h) - 18)
}
on ^1:HOTLINK:*youtube.com/watch?*:#:{
if ($yread(settings,i) !== 0) && ($mouse.key & 1) {
youview $1
}
}
on *:dialog:youview:*:*: {
if ($devent == init) {
dcx Mark $dname youview_cb
xdialog -c $dname 1 webctrl 0 0 $yread(settings,w) $calc($yread(settings,h) - 18) tabstop
}
}
alias youview_cb return

Comments

Sign in to comment.
hxck   -  Apr 23, 2013
I updated it to work for youtu.be links as well. http://paste2.org/4IM0t8Gs
 Respond  
thegingon   -  Aug 07, 2012
* /dialog: 'youview' invalid table, in 'size' (line 64, youtube.mrc)
 Respond  
ulquiorra4   -  Mar 07, 2012
X)
 Respond  
sKIRc   -  Mar 04, 2012
thanks :) its work nice~!!
 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.