Simple Audio Video Embedder

Started by SMFHacks.com Team, August 09, 2010, 10:42:47 PM

Previous topic - Next topic

Aportadordelmix



DaleM

Minor suggestion: I'd like to see the sites sorted alphabetically when on the Settings page. As more and more sites are added, it may become difficult to find which ones you have available. I simply added an "ORDER BY title" in the MediaProSettings function:

SELECT
  id, title, website, enabled
FROM {$db_prefix}mediapro_sites
ORDER BY title


There are also Halo 3/ODST videos at the Bungie.net [nofollow] site that I posted yesterday, and their link is slightly different (fileID instead of fid). I modifed the regexmatch and embedcode for Bungie.net [nofollow] as follows:

Code (regexmatch field) Select
http://www.bungie.net/Silverlight/bungiemediaplayer/embed.aspx\?(fid|fileId)=([0-9]*)

Code (embedcode field) Select
<iframe src="http://www.bungie.net/Silverlight/bungiemediaplayer/embed.aspx?$1=$2" scrolling="no" style="padding:0;margin:0;border:0;" width="640" height="360" ></iframe>

Both of these links should embed correctly after the update to the Bungie.net [nofollow] record:

http://www.bungie.net/Silverlight/bungiemediaplayer/embed.aspx?fid=2197750
http://www.bungie.net/Silverlight/bungiemediaplayer/embed.aspx?fileId=93759352


Thanks again. And I'll post any additional sites that I add so you may consider them for future releases.

DaleM

SQL insert statements below for 3 more sites. id (auto-increment field) not included. Table name assumes the prefix is "smf_" - so change accordingly.

All 3 are gaming related sites. And you may want to double-check my regular expressions. They work, but not 100% sure they are optimal. :)



INSERT INTO smf_mediapro_sites (title, enabled, website, regexmatch, embedcode, processregex, height, width) VALUES ('G4tv', 0, 'http://www.g4tv.com', 'http://g4tv.com/videos/([0-9]*)/([a-zA-Z0-9_\\-]*)/', '<object classId="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="480" height="418" id="VideoPlayerLg$1"><param name="movie" value="http://g4tv.com/lv3/$1" /><param name="allowScriptAccess" value="always" /><param name="allowFullScreen" value="true" /><embed src="http://g4tv.com/lv3/$1" type="application/x-shockwave-flash" name="VideoPlayer" width="480" height="382" allowScriptAccess="always" allowFullScreen="true" /></object>', NULL, 0, 0);

INSERT INTO smf_mediapro_sites (title, enabled, website, regexmatch, embedcode, processregex, height, width) VALUES ('IGN', 0, 'http://www.ign.com', 'http://www.ign.com/videos/([0-9]*)/([0-9]*)/([0-9]*)/([a-zA-Z0-9_=\\-\\?]*)', '<object id="vid" class="ign-videoplayer" width="480" height="270" data="http://media.ign.com/ev/prod/embed.swf" type="application/x-shockwave-flash"><param name="movie" value="http://media.ign.com/ev/prod/embed.swf" /><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="bgcolor" value="#000000" /><param name="flashvars" value="url=http://www.ign.com/videos/$1/$2/$3/$4"/></object>', NULL, 0, 0);

INSERT INTO smf_mediapro_sites (title, enabled, website, regexmatch, embedcode, processregex, height, width) VALUES ('Joystiq', 0, 'http://www.joystiq.com', 'http://www.joystiq.com/video/([a-zA-Z0-9]*)', '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="437" height="266" id="viddler"><param name="movie" value="http://www.viddler.com/simple/$1" /><param name="allowScriptAccess" value="always" /><param name="allowFullScreen" value="true" /><param name="flashvars" value="fake=1"/><embed src="http://www.viddler.com/simple/$1" width="437" height="266" type="application/x-shockwave-flash" allowScriptAccess="always" allowFullScreen="true" flashvars="fake=1" name="viddler" ></embed></object>', NULL, 0, 0);



vbgamer45

Awesome thanks so much will get these added along with your other ideas
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

BlownShovel

Quote from: zrorox on September 07, 2010, 11:19:36 AM
Mr. vbgamer45, I am VERY thankful for this mod! :D

I just have one question/recommendation... is there a tag I can use  to disable a video from being embedded? For example, I wanted to list a bunch of youtube videos without them being embedded, but still have the latest video in the list embedded.

I would also recommend having the auto-embed function turn off when using the [ url ] tag.

Thanks again for your work! :)

Mod works great..  too well as we would like to disable Signature video embedding.  We asked folks to use #ws at the end of the URL but since that bug is now fixed..   Is there disable preview tag?  Or possibly a Mod to not embed signatures?

Thanks

DaleM

I don't want you to take this as a complaint, vbgamer. I'm really liking this mod and this is just a general question for you or anyone:

I'd like for users to be able to post "embed" type code, not just the URL. I don't see any mods that do that, so I assume it is not very easily implemented.

Is it a security issue (even though it would be validated against an entry in the database)? Or something to do with the way SMF rewrites URL strings? Or something else?

If a URL can be checked to ensure it is valid, then modified into embed code - what prevents embed code to be checked/validated?

Thanks for any insight.  :)

青山 素子

Quote from: DaleM on October 06, 2010, 09:18:05 AM
Is it a security issue (even though it would be validated against an entry in the database)? Or something to do with the way SMF rewrites URL strings? Or something else?

If a URL can be checked to ensure it is valid, then modified into embed code - what prevents embed code to be checked/validated?

Security issue. Because embed/object tags can have different parameters or even different line breaks, it's much more difficult to assure it is valid versus a URL which is a single line with a somewhat more consistent format. If you're too loose at checking the embed code, someone can potentially slip something in that is undesirable. If you're too strict in checking the code, it may not work if someone makes even a small, benign change.
Motoko-chan
Director, Simple Machines

Note: Unless otherwise stated, my posts are not representative of any official position or opinion of Simple Machines.


vbgamer45

Quote from: BlownShovel on October 05, 2010, 06:44:20 PM
Quote from: zrorox on September 07, 2010, 11:19:36 AM
Mr. vbgamer45, I am VERY thankful for this mod! :D

I just have one question/recommendation... is there a tag I can use  to disable a video from being embedded? For example, I wanted to list a bunch of youtube videos without them being embedded, but still have the latest video in the list embedded.

I would also recommend having the auto-embed function turn off when using the [ url ] tag.

Thanks again for your work! :)

Mod works great..  too well as we would like to disable Signature video embedding.  We asked folks to use #ws at the end of the URL but since that bug is now fixed..   Is there disable preview tag?  Or possibly a Mod to not embed signatures?

Thanks
You might be able to use the nobbc tag but not sure if it will work.
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

DaleM

Quote from: 青山 素子 on October 06, 2010, 11:10:34 AM
If you're too loose at checking the embed code, someone can potentially slip something in that is undesirable. If you're too strict in checking the code, it may not work if someone makes even a small, benign change.

Makes perfect sense. Thanks for the clarification.

DaleM

Entry for JibJab (URL for testing - http://sendables.jibjab.com/view/fDGoIUKpcAROeoLG)

INSERT INTO smf_mediapro_sites (title, enabled, website, regexmatch, embedcode, processregex, height, width) VALUES ('JibJab', 0, 'http://www.jibjab.com', 'http://sendables.jibjab.com/view/([A-Za-z0-9]*)', '<object id="A64060" quality="high" data="http://aka.zero.jibjab.com/client/zero/ClientZero_EmbedViewer.swf?external_make_id=$1" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" wmode="transparent" height="319" width="425"><param name="wmode" value="transparent"></param><param name="movie" value="http://aka.zero.jibjab.com/client/zero/ClientZero_EmbedViewer.swf?external_make_id=$1"></param><param name="scaleMode" value="showAll"></param><param name="quality" value="high"></param><param name="allowNetworking" value="all"></param><param name="allowFullScreen" value="true" /><param name="FlashVars" value="external_make_id=$1"></param><param name="allowScriptAccess" value="always"></param></object>', NULL, 0, 0);


BlownShovel

Quote from: vbgamer45 on October 06, 2010, 11:34:55 AM
Quote from: BlownShovel on October 05, 2010, 06:44:20 PM
Quote from: zrorox on September 07, 2010, 11:19:36 AM
Mr. vbgamer45, I am VERY thankful for this mod! :D

I just have one question/recommendation... is there a tag I can use  to disable a video from being embedded? For example, I wanted to list a bunch of youtube videos without them being embedded, but still have the latest video in the list embedded.

I would also recommend having the auto-embed function turn off when using the [ url ] tag.

Thanks again for your work! :)

Mod works great..  too well as we would like to disable Signature video embedding.  We asked folks to use #ws at the end of the URL but since that bug is now fixed..   Is there disable preview tag?  Or possibly a Mod to not embed signatures?

Thanks
You might be able to use the nobbc tag but not sure if it will work.

No luck.  After the video link it will clear the link.  Before it will show but the hot link (url) is no longer valid.

vbgamer45

You can try like #wzx or something random that would throw it off.
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

Zerito

somes videos of MegaVideo got this estructure:
hxxp:www.megavideo.com/?d=HNEOW33U [nonactive]
with ?d    .. when put a video, dont show in post

brocoli

Is it possible to add an option so that it only scans for links inside a new "embed" bbcode tag? (i.e., not a tag that would translate into html embed code, just a way to let members specify which links should be embedded and which shouldn't.)


青山 素子

Motoko-chan
Director, Simple Machines

Note: Unless otherwise stated, my posts are not representative of any official position or opinion of Simple Machines.


goforit

hi, thank you for this mod, it works great ...however please could you add a feature to include video clips from this site ... i wanted to add this video to my site but it will not show.


http://video.foxbusiness.com/v/4229486/dierks-bentley-performs-senor-tales-of-yankee-power/

supadupajack

I have tried without success to install your mod on our SMF 2.0 RC3 board.
I manually parsed the files and made all modifications per the instructions and pushed files to the server yet I am still unable to find it in the admin.

I did find these two errors in the error log:

Any suggestions would be greatly appreciated.

Undefined index: mediapro_settings
Sources/Admin.php
Line: 239

Undefined index: mediapro_settings
Admin.php
Line: 232

Thanks!

vbgamer45

Sounds like you are missing a language string copy the text from themes/default/languages/modifications.english.php to themes/default/languages/modifications.youlanguage.php
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

Advertisement: