Results 1 to 6 of 6

Thread: push image

  1. #1
    Member
    Join Date
    Jan 2011
    Location
    none
    Posts
    5

    push image

    Hello,
    Is it possible to push image into client browser?

    Thanks,
    Semua

  2. #2
    Administrator
    Join Date
    Jul 2006
    Location
    Milan
    Posts
    975
    You can read this similar thread.

  3. #3
    Administrator
    Join Date
    Jul 2006
    Location
    Milan, Italy
    Posts
    517
    Semua,

    As for displaying pushed images in an HTML page, you can use data URI scheme (see http://en.wikipedia.org/wiki/Data_URI_scheme).

    Basically, you will push the Base64-encoded image as the value of a field of subscribed item. Your JavaScript code will change the src property if the img to inject the Base64-encoded source.

  4. #4
    Member
    Join Date
    Jan 2011
    Location
    none
    Posts
    5
    Hello,

    Rather than do encode image into base64.
    Can lightstreamer just push the image file name? and then in client browser, it will replace the old src value in the <img /> tag?
    I see in the example folder, all of them are using div / span as a place to put the text.

    Thanks

  5. #5
    Administrator
    Join Date
    Jul 2006
    Location
    Milan
    Posts
    975
    In that case, you can get the filename field values through the onItemUpdate callback;
    from there, you can modify the <img> element by your code.
    The StockListDemo, for instance, shows the use of fields that are not associated to cells (see "item_status")
    and the dynamical modification of an image filename (though not directly from a field value, in that case).
    Note that the filename field cannot be associated with a cell directly,
    hence you cannot define your Table by specifying null as the schema descriptor.

    If there are no fields to be associated with cells in your item containing the filename field, you can use a NonVisualTable.
    There are no simple examples showing the NonVisualTable; however, using a NonVisualTable is simpler than using the other kinds of tables.

  6. #6
    Member
    Join Date
    Jan 2011
    Location
    none
    Posts
    5
    Ok, it's working now

    Thanks,
    Semua

 

 

Similar Threads

  1. Push Notifications
    By BKnight in forum Client APIs
    Replies: 1
    Last Post: April 12th, 2012, 05:29 PM
  2. Push and Subscription Buffering
    By Cerogil in forum Adapter APIs
    Replies: 7
    Last Post: October 29th, 2010, 10:58 AM
  3. J2EE app to push message via LS w/o JMS
    By atamel in forum General
    Replies: 3
    Last Post: August 9th, 2010, 03:09 PM
  4. Sending an image to the client
    By mnanda in forum Client APIs
    Replies: 2
    Last Post: July 16th, 2010, 12:04 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT +1. The time now is 12:45 PM.