This is a message.

Add linkURL property to ContextMenu item Created Aug 14, 2009

This thread is solved

Views: 4509     Replies: 2     Last reply Oct 13, 2010  
You must login first before you can use this feature

MEDIAmobz

Posts: 10

Registered:
Dec 10, 2008

Add linkURL property to ContextMenu item

Posted: Aug 14, 2009

Right now context menu links don't work if embedding with the <object> tags.

Instead of just allowing a callback function for context menu items, add support for a "linkURL":http://mediamobz.com" or similar property that could be used in the embed object config parameters.

Example:


<object ...... config={ ..... "contextMenu":[{"Get Custom Video":{ "linkURL":"http://mediamobz.com/getvideo"} } }].... ></object>

Hopefully that example isn't too confusing with the missing parts.

MEDIAmobz

Posts: 10

Registered:
Dec 10, 2008

» Add linkURL property to ContextMenu item

Posted: Aug 19, 2009

Reply to: Add linkURL property to ContextMenu item, from mediamobz
Well, I implemented a different strategy. I changed addCustomMenuItem in ContextMenuBuilder.as:

CONFIG::commercialVersion
private function addCustomMenuItem(menu:ContextMenu, label:String, itemIndex:int, callback:String, separatorBeforeNextItem:Boolean):void {
  if (! callback || callback == "null") {
    addItem(menu, new ContextMenuItem(label, separatorBeforeNextItem, false));
  } else if (callback.substring(0, 7) == "http://" || callback.substring(0, 8) == "https://") {
    log.debug("creating item with url");
    addItem(menu, new ContextMenuItem(label, separatorBeforeNextItem, true), function(event:ContextMenuEvent):void {
      navigateToURL(new URLRequest(callback), "_self");
    });
  } else {
    log.debug("creating item with callback");
    addItem(menu, new ContextMenuItem(label, separatorBeforeNextItem, true), createCallback(itemIndex));
  }
}
It's not the prettiest, but if your "callback" routine starts with http:// or https:// then it will just create a url link to that address. Feel free to use this code, I created it and it is now GPL licensed as well. :-)

Example object embed code:

"contextMenu":[{"Get Custom Video":"http://mediamobz.com/postjob"},{"About MEDIAmobz...":"http://mediamobz.com/"}]

JamesB

Posts: 10

Registered:
Aug 31, 2010

» » Add linkURL property to ContextMenu item

Posted: Oct 13, 2010

Reply to: » Add linkURL property to ContextMenu item, from mediamobz
Was this ever implemented into the mainline flowplayer?