Sunday 21 October 2018

Picture-in-Picture Javascript and Html example

Picture-in-Picture Javascript and Html , Chrome latest 70 version support 

#PictureinPicture #javascript #Chrome70


  Your Html <style>
video { background: #1e2327; border-radius: 4px; width: 100%; }
button { margin: 4px 0; }
</style>

<video id="video" controls playsinline
src="https://storage.googleapis.com/media-session/caminandes/short.mp4"
poster="https://storage.googleapis.com/media-session/caminandes/artwork-512.png"></video>
<button id="togglePipButton">Toggle Picture-in-Picture</button>

Your Javascript Code

let pipWindow;

togglePipButton.addEventListener('click', async function(event) {
  log('Toggling Picture-in-Picture...');
  togglePipButton.disabled = true;
  try {

    if (video !== document.pictureInPictureElement)
      await video.requestPictureInPicture();
    else
      await document.exitPictureInPicture();

  } catch(error) {
    log(`> Argh! ${error}`);
  } finally {
    togglePipButton.disabled = false;
  }
});

// Note that this can happen if user clicked the "Toggle Picture-in-Picture"
// button but also if user clicked some browser context menu or if
// Picture-in-Picture was triggered automatically for instance.
video.addEventListener('enterpictureinpicture', function(event) {
  log('> Video entered Picture-in-Picture');

  pipWindow = event.pictureInPictureWindow;
  log(`> Window size is ${pipWindow.width}x${pipWindow.height}`);

  pipWindow.addEventListener('resize', onPipWindowResize);
});

video.addEventListener('leavepictureinpicture', function(event) {
  log('> Video left Picture-in-Picture');

  pipWindow.removeEventListener('resize', onPipWindowResize);
});

function onPipWindowResize(event) {
  log(`> Window size changed to ${pipWindow.width}x${pipWindow.height}`);
}

/* Feature support */

if ('pictureInPictureEnabled' in document) {
  // Set button ability depending on whether Picture-in-Picture can be used.
  setPipButton();
  video.addEventListener('loadedmetadata', setPipButton);
  video.addEventListener('emptied', setPipButton);
} else {
  // Hide button if Picture-in-Picture is not supported.
  togglePipButton.hidden = true;
}

function setPipButton() {
  togglePipButton.disabled = (video.readyState === 0) ||
                             !document.pictureInPictureEnabled ||
                             video.disablePictureInPicture;
}




picture in picture mode tutorial with example




Thursday 20 September 2018

Surat Diamond ganpati



Surat ganpati

Surat Diamond ganpati

                         Surat Diamond ganpati click hear





ધ્યાન-

ॐ सिन्दूर-वर्णं द्वि-भुजं गणेशं लम्बोदरं पद्म-दले निविष्टम्।
ब्रह्मादि-देवैः परि-सेव्यमानं सिद्धैर्युतं तं प्रणामि देवम्।।
।। મૂળપાઠ ।।
सृष्ट्यादौ ब्रह्मणा सम्यक् पूजित: फल-सिद्धए।
सदैव पार्वती-पुत्र: ऋण-नाशं करोतु मे।।1
त्रिपुरस्य वधात् पूर्वं शम्भुना सम्यगर्चित:।
सदैव पार्वती-पुत्र: ऋण-नाशं करोतु मे।।2
हिरण्य-कश्यप्वादीनां वधार्थे विष्णुनार्चित:।
सदैव पार्वती-पुत्र: ऋण-नाशं करोतु मे।।3
महिषस्य वधे देव्या गण-नाथ: प्रपुजित:।
सदैव पार्वती-पुत्र: ऋण-नाशं करोतु मे।।4
तारकस्य वधात् पूर्वं कुमारेण प्रपूजित:।
सदैव पार्वती-पुत्र: ऋण-नाशं करोतु मे।।5
भास्करेण गणेशो हि पूजितश्छवि-सिद्धए।
सदैव पार्वती-पुत्र: ऋण-नाशं करोतु मे।।6
शशिना कान्ति-वृद्धयर्थं पूजितो गण-नायक:।
सदैव पार्वती-पुत्र: ऋण-नाशं करोतु मे।।7
पालनाय च तपसां विश्वामित्रेण पूजित:।
सदैव पार्वती-पुत्र: ऋण-नाशं करोतु मे।।8
इदं त्वृण-हर-स्तोत्रं तीव्र-दारिद्र्य-नाशनं,
एक-वारं पठेन्नित्यं वर्षमेकं सामहित:।
दारिद्र्यं दारुणं त्यक्त्वा कुबेर-समतां व्रजेत्।।







Wednesday 25 April 2018

Update Column With Random predefined word list in PostgreSQL


   Update Column With Random  enum word list in PostgreSQL ?
   How to Update Column With Random word ?

    UPDATE stock
    SET shape = (
              (
               ARRAY['CS','CM','RN','EM','AS','PR','OV','HT','BG','Round','MQ','PC']
              )          [floor(random()*12)+1]
           );

Update Date Column With RANDOM date in PostgreSQL



Random Dates and Numbers in PostgreSQL with the RANDOM() Function



select NOW() + (random() * (NOW()+'90 days' - NOW())) + '30 days';

UPDATE stock SET trans_date = NOW() + (random() * (NOW()+'90 days' - NOW())) + '30 days';



Monday 23 April 2018

How to Flush/Clean DNS cache in Ubuntu 16.04 and Ubuntu 20.04



In Windows, we useipconfig /flushdnsin Ubuntu 16.04  run this command to flush dns cache:
sudo /etc/init.d/dns-clean restart

or use:

sudo /etc/init.d/networking force-reload


Ubuntu 20.04 

How to Clear DNS Cache on Ubuntu?

We can run the following command to clear the DNS cache on Ubuntu.

 sudo systemd-resolve --flush-caches



Friday 13 April 2018

SURAT: India's first district cooperative bank built on the green concept

 SURAT: India's first district cooperative bank built on the green concept will be inaugurated in the diamond city by Chief Minister Vijay Rupani on Friday
Established in 1909, the 109-year-old Surat district cooperative bank  has become the first among the 370 district banks in India and 18 district banks in Gujarat for constructing its new headquarter in the diamond city’s Majura Gate on the green building concept. Constructed on 45,000 square feet, the bank took just 15 months for completition at the cost of Rs 34 crore.


The terrace of the district bank is installed with rooftop solar plant for generating 36 kilowatts of electricity for its in-house needs. The solar panels have been so designed that the electricity requirements would be met even during the monsoon season.

The five-storey bank building has green patches for gardening at each of the floors. The entry of the building has a green landscape with lush garden for providing a different feeling to the customers visiting the bank. Each floor has the facility of toilets and reception, mineral RO plants for clean drinking water etc.

Watch a New Surat district cooperative bank in 360 degree.


SURAT district cooperative bank entrance gate


Saturday 24 February 2018

Install Latest and update Node js in Ubuntu


On Ubuntu 16.04 LTS the easier way is
1 Install npm:
sudo apt-get install npm
2.Install n
sudo npm install n -g
3 Get latest version of node
sudo n latest
If you prefer to install a specific version of `node you can
4 List available node versions
n ls
5 and the install a specific version

sudo n 4.5.0